#K16161. Pair Sum Finder

    ID: 24518 Type: Default 1000ms 256MiB

Pair Sum Finder

Pair Sum Finder

In this problem, you are given an array of integers and a target integer (k). Your task is to determine if there exist two distinct elements in the array such that their sum equals (k). More formally, you need to find if there exist indices (i) and (j) (with (i \neq j)) such that $$A_i + A_j = k$$. If such a pair exists, print "Found"; otherwise, print "Not Found".

Example:
Input: 5 9 and array: [1, 2, 3, 4, 5]
Output: Found

inputFormat

The input begins with an integer (T), representing the number of test cases. Each test case consists of two lines. The first line of each test case contains two integers (n) and (k), where (n) is the size of the array and (k) is the target sum. The second line contains (n) space-separated integers — the elements of the array.

outputFormat

For each test case, output a single line containing either "Found" if a pair of distinct elements that add up to (k) is found, or "Not Found" if no such pair exists.## sample

2
5 9
1 2 3 4 5
4 8
2 2 2 2
Found

Not Found

</p>