Apples and Bananas
For each combined weight `2..2k`, the number of apple/banana pairs with that total.
There are apples and bananas, and each of them has an integer weight between . Your task is to calculate, for each weight between , the number of ways we can choose an apple and a banana whose combined weight is .
Input
The first input line contains three integers , and : the number , the number of apples and the number of bananas.
The next line contains integers : weight of each apple.
The last line contains integers : weight of each banana.
Output
For each integer between print the number of ways to choose an apple and a banana whose combined weight is .
Constraints
Example
Input:
5 3 4 5 2 5 4 3 2 3
Output:
0 0 1 2 1 2 4 2 0
Explanation: For example for = there are different ways: we can pick an apple of weight in two different ways and a banana of weight in two different ways.
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/ApplesAndBananas/Spec.lean.
Submit
binary + proofResults
No scoring submissions yet. One counts once the kernel accepts its proof and every test passes.
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.