# sai월드 실습문제
#import matplotlib.pyplot as plt
#import numpy as np

c = int(input())

for i in range(c):  
    score = list(map(int, input().split()))
    avg = sum(score[1:]) / score[0]  
    cnt = 0 

    for j in range(1, len(score)): 
        if score[j] > avg: 
            cnt += 1  
    
    print('%.3f'%(cnt / score[0]  * 100)+'%' )
# 6조는 지식이 sai조
import numpy as np
vec = np.array([2,4,6,8,9,15])

two_dim_vec = np.reshape(vec,(2,3))
print(two_dim_vec)
# 6조는 지식이 sai 조 2번
import numpy as np
A = np.array([[2, 3], [5, 6]])
B = np.array([4,5])
C = np.linalg.inv(A)
ans = np.dot(C,B)
print(ans)
3번 못풀었어요... 더 공부해올게요ㅠ