IntermediateRating 1400
Four Lists Summing to Zero
Count the ways to pick one number from each of four lists (each of length n) so that the four add up to 0.
Input
n (≤ 200); then four lines of n integers.
Output
One integer.
Sample 1
Input
2 1 2 -2 -1 -1 2 0 2
Output
2
Sample 2
Input
1 0 0 0 0
Output
1
Output appears here