t = int(input())
res = []
for i in range(t):
n , x = map(int,input().split())
alist = list(map(int,input().split()))
length = len(alist)
count = 0
alist = sorted(alist)
while x*length >= sum(alist): #数组的和大于平均分乘人数
alist[count] = 100#####
count += 1
res.append(count)
for i in res:
print(i)
第二题
n = int(input())
# n=10
alist = list(map(int,input().split()))
# alist = [10,9, 7, 8, 6, 5, 3, 4, 2, 1 ]
count = 0
while alist != sorted(alist):
temp = [alist[0]]#辅助数组,原数组的第一个数是肯定一直存在的
for i in range(1,len(alist)):
if alist[i]>alist[i-1]:
temp.append(alist[i]) #辅助数组保存该晚上幸存的人
count += 1
alist = temp
print(count)