#C797. Maximum Problems Solved

    ID: 51899 Type: Default 1000ms 256MiB

Maximum Problems Solved

Maximum Problems Solved

Problem Statement:

Given the scores of participants in multiple test cases, your task is to determine, for each test case, the maximum number of problems solved by any participant and count how many participants achieved that score.

For a test case with (N) participants and scores (a_1, a_2, \dots, a_N), you need to compute $$\max{a_1, a_2, \dots, a_N}$$ and then count the number of occurrences of this maximum value.

inputFormat

Input Format:

The first line contains an integer (T), the number of test cases. Each test case consists of two lines. The first line of each test case contains an integer (N), the number of participants. The second line contains (N) space-separated integers, where each integer represents the number of problems solved by a participant.

outputFormat

Output Format:

For each test case, output a single line with two space-separated integers: the maximum number of problems solved and the count of participants who solved that many problems.## sample

2
5
1 3 2 3 4
6
1 2 2 2 3 3
4 1

3 2

</p>