#C14983. Student With Highest Average Score

    ID: 44692 Type: Default 1000ms 256MiB

Student With Highest Average Score

Student With Highest Average Score

Given a list of student records, each record includes a student's name and a list of their scores in various subjects. Your task is to determine the student with the highest average score. In case two or more students have the same average score, output the student whose name comes first in alphabetical order.

Note: If any student has an empty scores list, the program should output Error.

The average is computed using the formula \(\text{average} = \frac{\text{sum of scores}}{\text{number of scores}}\).

inputFormat

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

  1. The first line contains a single integer \(n\) representing the number of student records.
  2. Each of the next \(n\) lines contains a student record. Each record starts with the student's name (a single word), followed by one or more integers which represent the scores obtained by the student. The numbers are separated by spaces.

If a student record does not contain any scores, the program should output Error.

outputFormat

The output, written to standard output (stdout), is a single line containing the name of the student with the highest average score. In case of a tie, the student whose name comes first in alphabetical order is output. If any student record has an empty scores list, output Error.

## sample
1
Alice 80 90 85
Alice