You are viewing a single comment's thread. Return to all comments →
for a0 in range(int(input())): x=[int(y)for y in input().split()] n,k=x[0],x[1] ar=[int(y)for y in input().split()] s=n b=[] for i in range(n): if ar[i]>k: b.append(s) s-=1 first=0 if len(b)==0: print(0) continue total=0 for i in range(n): if ar[i]<=k: total+=b[first] elif ar[i]>k: total+=b[first] first+=1 if first==len(b): break print(total)
Number List
You are viewing a single comment's thread. Return to all comments →