#C2597. Unique Sum Pair Counter
Unique Sum Pair Counter
Unique Sum Pair Counter
Given an array \(A\) of integers and an integer target \(T\), your task is to count the number of unique pairs \((a, b)\) from the array such that
\(a + b = T\).Each pair is considered unique regardless of order, meaning that the pair \((a, b)\) is the same as \((b, a)\). If there are multiple occurrences of the same numbers, they should only be counted once.
Note: The input is provided via standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The input consists of three parts provided via stdin:
- An integer \(N\) representing the number of elements in the array \(A\).
- A line with \(N\) space-separated integers representing the array \(A\). If \(N = 0\), this line will be empty.
- An integer \(T\) representing the target sum.
outputFormat
Output a single integer representing the number of unique pairs \((a, b)\) such that \(a + b = T\).
## sample5
1 5 7 -1 5
6
2