#K76962. Pair Sum Finder
Pair Sum Finder
Pair Sum Finder
You are given an array of integers and a target integer \(t\). Your task is to determine whether there exists a pair of distinct elements in the array whose sum is equal to \(t\). Formally, for an array \(a\) with \(m\) elements, find indices \(i\) and \(j\) where \(i < j\) such that \(a_i + a_j = t\). If such a pair exists, output Pair found
; otherwise, output No pair found
.
inputFormat
The input begins with an integer \(T\) denoting the number of test cases. Each test case consists of two lines. The first line contains two integers \(m\) and \(t\), where \(m\) is the number of elements in the array and \(t\) is the target sum. The second line contains \(m\) space-separated integers representing the elements of the array.
outputFormat
For each test case, output a single line containing either Pair found
if a pair with a sum equal to \(t\) exists, or No pair found
otherwise.
1
4 6
1 2 3 4
Pair found
</p>