SUMX
A sequence of positive integers , , , , and an integer are given. Write a program to find the number of pairs , where and .
Input
The first line of the input contains two numbers and , separated by a single space. The second line contains the integers of the sequence, separated in pairs by spaces.
Output
The output should consist of a single line containing exactly one integer: the desired number of pairs.
Constraints
Execution time limit: 1 sec.
Memory limit: 64 MB.
Examples of Input - Output Files:
1st
STDIN (sumx.in)
9 13
5 12 7 10 9 1 2 3 11
STDOUT (sumx.out)
3
Explanation of the first example: In the first example, the possible pairs are three:
2nd
STDIN (sumx.in)
5 12
1 2 3 4 6
STDOUT (sumx.out)
0
Explanation of the second example: In the second example, there is no pair that sums up to .
3d
STDIN (sumx.in)
6 10
2 4 6 8 4 6
STDOUT (sumx.out)
5
Explanation of the third example: Finally, in the third example, the possible pairs are five (pay attention to the repeating terms):
Comments