In the ribbon falls of Cascade Vale, Arjun the registry keeper keeps careful count of the coins. Recover the missing manifest, every figure matters. Task: Read n integers and a target k. Print the number of index pairs (i,j) with i < j such that a[i] + a[j] = k. Input format: First line: n and k. Second line: n space-separated integers. Output format: Print the count of valid pairs. Constraints: 2 <= n <= 2000; -100 <= a[i],k <= 1000.
Example 1:
Example 2:
Example 3:
Constraints:
2 <= n <= 2000; -100 <= a[i],k <= 1000.
