#K9736. Pair Sum Problem
Pair Sum Problem
Pair Sum Problem
You are given a list of integers and a target integer (T). Your task is to determine whether there exists a pair of distinct elements in the list whose sum equals (T).
Formally, given an array (A = [a_1, a_2, \dots, a_n]) and an integer (T), check if there exist two indices (i) and (j) such that (i \neq j) and (a_i + a_j = T).
inputFormat
The input is given via standard input (stdin) and consists of three lines:
1. The first line contains an integer (n), the number of elements in the list.
2. The second line contains (n) space-separated integers representing the list. (If (n = 0), this line will be empty.)
3. The third line contains a single integer (T), the target sum.
outputFormat
Output a single line to standard output (stdout) containing either "True" if there exists a pair of distinct elements that sum up to (T), or "False" otherwise.## sample
4
10 15 3 7
17
True
</p>