#C13532. Pair Sum Check

    ID: 43081 Type: Default 1000ms 256MiB

Pair Sum Check

Pair Sum Check

Given an array of integers and a target integer \(T\), determine whether there exist two distinct elements \(a_i\) and \(a_j\) in the array such that \(a_i + a_j = T\). Print True if such a pair exists, and False otherwise.

In other words, you need to check if there exist indices \(i \neq j\) for which \(a_i + a_j = T\). Use efficient methods to solve the problem.

inputFormat

The input is given from stdin in the following format:

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

outputFormat

Output a single line to stdout containing either True or False indicating whether a pair with the given sum exists.

## sample
4
10 15 3 7
17
True