

Return -1 if the value of ‘K’ exceeds the number of elements in the array ‘product’.
Input array “arr”= [1, 2, 3, 4] and K = 3
Output: 4
Explanation: The ‘product’ array i.e array formed by multiplying each pair of element of ‘Arr’ is [1*2, 1*3, 1*4, 2*3, 2*4, 3*4] = [2, 3, 4, 6, 8, 12]. So the Kth(K = 3) element in this sorted ‘product’ array is 4.
The first line of input contains an integer 'T' which denotes the number of test cases or queries to be run. Then the test cases follow.
The first line of each test case contains two integers separated by a single space i.e N and K.
The second and last line of each test case contains N single space-separated integers representing the elements of the input array ‘Arr’.
For each test case, print the Kth element of the ‘product’ array after sorting it in non-decreasing order.
Output for every test case will be printed in a separate line.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 50
1 <= N <= 10^4
1 <= K <= 10^9
-10^4 <= Arr[i] <= 10^4
Time Limit: 1 sec
Consider the array product { -1, -2, -3, 2, 3, 6 } and let k = 2.
Let's take an empty priority queue(max heap)
( (-1) -> (-2) ) (in the same order i.e. -1 will be at the top of the queue and -2 at the bottom).