Target Sum Pairs
Target Sum Pairs
Count unordered index pairs (i, j) with i < j and aᵢ + aⱼ equal to a target value x.
Input
The first line contains n and x (1 ≤ n ≤ 200000, |x| ≤ 10^9). The second line contains n integers |aᵢ| ≤ 10^9.
Output
Print the number of valid index pairs.
Example 1
Input
6 7 1 6 3 4 3 4
Output
5
Example 2
Input
5 0 -2 2 0 0 2
Output
3
Comments