mystery-and-party

Solve the mystery.

INPUT  :
First line contains  T No. of test cases.
Each test case contains two lines. First line contains two space separated integers ( N and K). Second line contains N space separated integers A [i].

OUTPUT :
Print the solution of this mystery in each line.

CONSTRAINTS :
1 ≤ T ≤ 100
1 ≤ N ≤ 10^5
1 ≤ K ≤ N
0 ≤ A[ i ] ≤ 10^9

Problem Setter : Rajan Kasodariya

SAMPLE INPUT
3
2 1
5 10 
3 3
1 2 3
4 2
10 20 1 2

SAMPLE OUTPUT
5
3
2

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
t = eval(input())
while t>0:
	t-=1
	n, k = list(map(int, input().split()))
	a = list(map(int, input().split()))
	a.sort()
	print(a[k-1])


for t in range(eval(input())):
	n,k=list(map(int,input().split()))
	lst=sorted(map(int,input().split()))
	print(lst[k-1])


t=int(input());
k=[];
k1=[];
while t!=0:
	t-=1;
	c=input();
	k=c.split();
	for key in range(len(k)):
		k[key]=int(k[key]);
	d=input();
	k1=d.split();
	for key in range(len(k1)):
		k1[key]=int(k1[key]);
	k1.sort();
	print(k1[k[1]-1]);
	

	


for _ in range(eval(input())):
	x=list(map(int,input().split()))
	y=list(map(int,input().split()))
	y.sort()
	print(y[x[1]-1])


if __name__=='__main__':
	T = int(input())
	for i in range(0,T):
		n,k = list(map(int,input().split()))
		numlist = list(map(int,input().split()))
		numlist = sorted(numlist)
		print(numlist[k-1])


for tc in range(eval(input())):
	n,k=[int(i) for i in input().split()]
	print((sorted([int(i) for i in input().split()])[k-1]))
	


tc=int(eval(input()))
while tc>0:
	n,k=list(map(int,input().split()))
	l=sorted(list(map(int,input().split())))
	print(l[k-1])
	tc=tc-1


t=eval(input())
for i in range(t):
	n,k=list(map(int,input().split()))
	a=sorted(map(int,input().split()))
	print(a[k-1])