Consider an array of positive integers a_1, a_2, \ldots, a_n, having values between and 10^6 and an integer . Write a program to determine the number of pairs (a_i, a_j), where 1 \leq i < j \leq n and a_i + a_j = x.
The first line contains the integer (1 \leq n \leq 10^5). The second line contains integers - the elements of array that can be repeated. On the third line the integer (1 \leq x \leq 2 \cdot 10^6) is given.
Print the calculated number of pairs.
1-nji mysal
2-nji mysal