#K13911. Highest Average Student

    ID: 24018 Type: Default 1000ms 256MiB

Highest Average Student

Highest Average Student

You are given a list of students, where each student has a name and a set of test scores in various subjects. Your task is to determine the student with the highest average score. The average score for a student is computed as

\(\text{average} = \frac{\text{sum of scores}}{\text{number of subjects}}\)

If multiple students obtain the same highest average score, return the one who appears first in the input.

Example:

Input:
3
Alice 3
Math 90
English 80
Science 70
Bob 3
Math 80
English 70
Science 80
Charlie 3
Math 90
English 90
Science 90

Output: Charlie

</p>

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains an integer N representing the number of students.
  • For each student, there is a line containing the student's name and an integer S (the number of subjects), separated by a space.
  • This is followed by S lines, each containing a subject name (a string without spaces) and an integer score for that subject.

outputFormat

Print a single line to standard output (stdout) containing the name of the student with the highest average test score. If there is a tie, output the name of the student who appears first in the input.

## sample
1
Alice 3
Math 90
English 80
Science 70
Alice