about summary refs log tree commit diff
path: root/codechef/qualprel.py
blob: 400974c5af6ca3f4632e2f36e5d481f4435e714d (plain) (blame)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env python2
from bisect import bisect_right
from sys import stdin

for _ in xrange(int(stdin.readline())):
    n, k = map(int, stdin.readline().split())
    s = [1000000000 - int(i) for i in stdin.readline().split()]
    s.sort()
    print bisect_right(s, s[k - 1])