#C5981. Highest Average Score Winner
Highest Average Score Winner
Highest Average Score Winner
You are given the number of participants and their respective scores. Each participant is uniquely identified by an ID and earns three scores. Your task is to determine the participant with the highest average score. In the case that two or more participants have the same average score, the participant with the lowest ID wins.
For a participant with scores s1, s2, and s3, the average score is calculated using the formula:
Output the ID of the winning participant.
inputFormat
The first line of input contains an integer N
representing the number of participants. The following N
lines each contain four integers: the participant's ID
and their three scores.
Example:
3 101 88 92 100 102 90 85 92 103 95 94 93
outputFormat
Output a single line containing the ID
of the participant with the highest average score. If multiple participants have the same average score, output the one with the smallest ID
.
3
101 88 92 100
102 90 85 92
103 95 94 93
103