#C3744. Top Student
Top Student
Top Student
You are given a list of students with their scores in three subjects: Mathematics, Science, and English. Write a program that reads from stdin and outputs the name of the student with the highest average score. The average score for a student is computed as:
\(\text{average} = \frac{\text{mathematics} + \text{science} + \text{english}}{3}\)
In case of a tie (i.e. when two or more students have the same average score), output the student whose name comes first in lexicographical (alphabetical) order.
The input is provided in the following format:
- The first line contains an integer
N
representing the number of students. - The following
N
lines each contain a student's information in the order: name (a string without spaces), mathematics score, science score, and english score (all integers), separated by spaces.
The output should be a single line containing the name of the top student.
inputFormat
The first line contains an integer N
(1 \(\leq N \leq 1000\)), the number of students. Each of the next N
lines contains a student's name and three integer scores corresponding to mathematics, science, and english, separated by spaces.
outputFormat
Output a single line containing the name of the student with the highest average score. If multiple students have the same average, output the name that comes first alphabetically.
## sample1
Alice 85 90 88
Alice
</p>