#K8436. Pair Sum Existence

    ID: 36402 Type: Default 1000ms 256MiB

Pair Sum Existence

Pair Sum Existence

You are given an array of integers and a target integer \(T\). Your task is to determine whether there exist two distinct elements in the array such that their sum equals \(T\) (i.e. for some indices \(i\) and \(j\) with \(i < j\), \(a_i + a_j = T\)).

If such a pair exists, print True; otherwise, print False.

For example, if the array is [2, 7, 11, 15] and \(T=9\), since \(2+7=9\), the output should be True.

inputFormat

The input is provided via standard input in the following format:

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

outputFormat

Output a single line to standard output containing either True or False depending on whether there exists a pair of distinct elements whose sum equals \(T\).

## sample
4
2 7 11 15
9
True

</p>