Given an array of integers, and an integer ‘K’ , find the count of pairs of elements in the array whose sum is equal to 'K'.
First line of the input contains an integer T, denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. First line of each test case contains 2 space separated integers N and K denoting the size of array and the sum respectively. Second line of each test case contains N space separated integers denoting the elements of the array.
Print the count of pairs of elements in the array whose sum is equal to the K.
1 5 7 1
1 1 1 1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.