#C2712. Unique Pair Sum
Unique Pair Sum
Unique Pair Sum
You are given an array of integers and a target sum \(T\). Your task is to count the number of unique unordered pairs \((i, j)\) such that the sum of the two elements equals \(T\). A pair \((a, b)\) is considered the same as \((b, a)\) and should be counted only once even if there are multiple occurrences in the array.
Input Constraints: The first line contains two integers \(n\) and \(T\), where \(n\) is the number of elements in the array. The second line contains \(n\) space-separated integers.
Example:
Input: 5 6 1 2 3 4 5</p>Output: 2
Here, the pairs that sum to 6 are (1, 5) and (2, 4). Note that the pair (3, 3) is not available.
inputFormat
The first line of input contains two integers \(n\) (the number of elements) and \(T\) (the target sum). The second line contains \(n\) space-separated integers representing the array elements.
outputFormat
Output the number of unique pairs whose sum is equal to \(T\>.
## sample5 6
1 2 3 4 5
2