PROBLEM
You simply need to check how many numbers greater than 999 are present in the list of numbers given.
for t in range(int(input())):
n = int(input())
l = list(map(int, input().split(" ")))
count = 0
for i in range(0, len(l)):
if l[i] > 999:
count += 1
print(count)