EPS/2024/05/29-05-24-Exam/a.py
2024-05-29 18:11:10 +02:00

11 lines
283 B
Python

def main():
n, stu_num = map(int, input().split())
res = [list(map(int, input().split())) for _ in range(n)]
res.sort(key=lambda x:x[1], reverse=True)
dico = {res[i][0]:i+1 for i in range(len(res))}
print(dico[stu_num])
for _ in range(int(input())):
main()