Kaity is collecting statistics for the latest iteration of the Berkeley Math Tournament. In the last tournament, she had
One day, Sylvia, her archnemesis, wanted to collect statistics about how well students did in the tournament. Sylvia has
Kaity is a nice person and wants the students to look as good as possible, so if multiple scores are tied for most frequent, she will tell Sylvia the largest mode.
Sylvia is impatient, so please answer her questions as quickly as possible!
Constraints
In tests worth 1 mark,
In tests worth an additional 2 marks,
In tests worth an additional 3 marks,
In tests worth an additional 4 marks,
Input Specification
The first line contains two integers,
The next line contains
The next
Output Specification
Output
Sample Input
5 3
2 1 2 1 1
1 2
1 4
1 5
Sample Output
2
2
1
Comments
Is it even possible to solve this problem in Python 3 or Pypy3? (not asking for the solution, but all the correct answers have been in C++)
The only languages where this problem is expected to be solvable are C and C++.