```
def count(a,b):#a's presence in b
n = 0
for i in range(len(b)):
if a == b[i]:
n += 1
return n
def comb(i,j):
if i == j:
return 1
elif j == 1:
return i
else:
c = comb(i-1,j-1) + comb(i-1,j)
return c
T = int(input())
for i in range(T):
N,K = map(int, input().split(" "))
A = list(map(int,input().split(" ")))
A.sort()
B = A[:K+1]
Z = B[-1]
cntZ = count(Z,B)
Y = count(Z,A)
print(comb(cntZ,Y))
```

why am i getting nzec error in this? works fie in my ide. please help