# your code goes here test=int(input()) def solve(): lis=[int(i)for i in input().split()] arr=[int(i)for i in input().split()] if arr[0]<lis[1]: present="first" else: present="second" count=1 for i in range(1,len(arr)): if arr[i]<lis[1] and present =="second": count+=1 present="first" # print(count,lis[i]) if arr[i]>=lis[1] and present=="first": count +=1 present="second" print(count) while test: solve() test-=1