#K60512. Pair with Given Sum

    ID: 31103 Type: Default 1000ms 256MiB

Pair with Given Sum

Pair with Given Sum

You are given a list of integers and a target integer \(T\). Your task is to check whether there exist two distinct numbers in the list whose sum is equal to \(T\). If the list contains fewer than two elements, the answer is False.

Example: For the list [1, 2, 3, 4] and target 5, since 1+4 = 5 (or 2+3 = 5), the output should be True.

You need to implement an efficient solution that reads input from stdin and prints the result (True or False) to stdout.

inputFormat

The input consists of three lines:

  1. The first line contains an integer \(n\) representing the number of elements in the list.
  2. The second line contains \(n\) space-separated integers.
  3. The third line contains a single integer representing the target sum \(T\).

outputFormat

Output a single line containing either True or False, indicating whether there exists a pair of numbers in the list whose sum equals the target.

## sample
4
1 2 3 4
5
True

</p>