any tips to make this code faster.
'''
def greaterButClosest (list, find):
found = -1
for idx in range (len(list)):
if list[idx] > find:
if found == -1:
found = idx
else:
if list[idx] < list[found]:
found = idx
if found == -1:
return -99999
return list[found]
a= int(input())
for i in range(a):
p=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
for tst in b:
vaar=greaterButClosest(a,tst)
if vaar in a:
a.remove(vaar)
print(p-len(a))
'''
Sample input
'''
1
10
3 6 7 5 3 5 6 2 9 1
2 7 0 9 3 6 0 6 2 6
'''
sample output:
7