1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T): test_case = int(input()) score_list = list(map(int, input().split())) score_list.sort(reverse=True) students = {} for i in range(101): students[i] = 0 for score in score_list: students[score] += 1 max_value = max(students.values()) result=0 for key, value in students.items(): if value == max_value: result = key print("#{0} {1}".format(test_case, result))
|