#C6857. Student with Most Practice
Student with Most Practice
Student with Most Practice
You are given a log containing practice sessions of various students. Each log entry consists of the student's name, the practice date, and the duration (in minutes) of the session. Your task is to identify the student who has accumulated the highest total practice duration over all sessions. In case of a tie, output the lexicographically smallest name.
The total duration for each student is computed as:
[ T_{\text{student}} = \sum_{i=1}^{n_i} \text{duration}_{i} ]
where \(n_i\) is the number of sessions for that student.
inputFormat
The first line contains an integer \(n\), representing the number of practice log entries. Each of the following \(n\) lines contains a student's name (a string without spaces), a date (an integer in the format YYYYMMDD), and a duration (an integer representing minutes), separated by whitespace.
outputFormat
Output the name of the student who practiced for the longest total duration. If there is a tie, output the lexicographically smallest name.
## sample5
Alice 20220301 30
Bob 20220301 45
Alice 20220302 60
Bob 20220303 15
Alice 20220303 25
Alice