Does a Pair Sum to Target
Decide whether two elements add up to a target (two-sum).
Input format
The first line has N. The second line has N integers. The third line has the target sum.
Output format
Print true if two elements at different positions add up to the target, otherwise false.
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
5
2 7 11 15 1
9Expected output
trueExample 2
Input
4
1 2 3 4
100Expected output
false