You are given an array containing N distinct integers. You perform the following operations on this array:
Write a program to find the Kth largest element of the array after all the operations have been performed. If there is no such element, print -1.
Input format
Output format
For each test case, print the Kth largest element of the array. If there is no such element print -1.
Constraints
1≤T≤100
1≤N,K≤10000
1≤ Element of the array ≤100000
Elements of the array after performing the above operation {1,2,3,4,5,6,7} . Hence 2nd largest element will be 6.