#C1833. Two Sum Problem

    ID: 45082 Type: Default 1000ms 256MiB

Two Sum Problem

Two Sum Problem

Given a list of integers and a target integer, determine whether any two distinct numbers in the list sum up exactly to the target value.

Challenge: You need to implement an efficient algorithm to check for the existence of such a pair. The answer should be True if such a pair exists, and False otherwise.

Note: The solution must read input from stdin and output the result to stdout.

inputFormat

The input consists of three parts provided via standard input:

  1. An integer n representing the number of elements in the list.
  2. A line of n space-separated integers.
  3. An integer representing the target sum.

outputFormat

Output a single line with True if there exists any pair of distinct numbers in the list that sum to the target, or False otherwise.

## sample
4
10 15 3 7
17
True