#K53402. Pair Sum Existence Problem
Pair Sum Existence Problem
Pair Sum Existence Problem
Given a list of integers and a target integer, determine if there exists a pair of distinct integers in the list whose sum equals the target.
More formally, given a list \(a_1, a_2, \ldots, a_n\) and a target \(T\), check if there exist indices \(i\) and \(j\) (with \(i \neq j\)) such that \(a_i + a_j = T\).
The solution should read input from stdin
and output the result to stdout
as either True
or False
.
inputFormat
The input consists of three lines:
- The first line contains an integer (n), the number of integers in the list.
- The second line contains (n) space-separated integers representing the list.
- The third line contains a single integer representing the target sum (T).
outputFormat
Output a single line: either "True" if there exists a pair of distinct integers whose sum is equal to (T), or "False" otherwise.## sample
5
3 5 -1 7 11
10
True