fork download
  1. # your code goes here
  2. T=int(input())
  3. for t in range(T):
  4. l=list(map(int,input().split()))
  5. c=0
  6. for i in range(1,len(l)):
  7. if l[0]<l[i]:
  8. c+=1
  9. print(c)
Success #stdin #stdout 0.04s 9860KB
stdin
4
2 3 4 1
10000 0 1 2
500 600 400 300
0 9999 10000 9998
stdout
2
0
1
3