#C12326. Find Two Sum

    ID: 41741 Type: Default 1000ms 256MiB

Find Two Sum

Find Two Sum

You are given an integer n and an array of n integers, followed by a target integer T. Your task is to find two distinct elements, a and b, in the array such that their sum equals T.

This can be mathematically stated as finding two numbers such that \[ a+b=T \] where \(a,b\in A\) and \(a\neq b\). If a valid pair exists, output the two numbers (in the order as determined by the algorithm); otherwise, output None.

The input will be given via stdin and the output should be printed to stdout.

inputFormat

The input is read from standard input (stdin) and is formatted as follows:

  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 the target integer T.

outputFormat

If a pair of numbers whose sum is equal to T exists, print the two integers separated by a space. If such a pair does not exist, print None.

## sample
4
2 7 11 15
9
7 2

</p>