← 返回 goldmansachs 的题目列表Best Average Score
类型:online_judge
Given n student score records, where each record contains a student name and an integer score for one course, compute each student's average score. Round every average down, then return the highest such average among all students.
For negative averages, use mathematical floor rounding. For example, -1.5 becomes -2.
Input Format
The first line contains an integer n, the number of score records.
The next n lines each contain a space-free student name name and an integer score.
Output Format
Print one integer: the highest floored average score.
Constraints
1 <= n <= 100,000
Name length is between 1 and 100
-10,000 <= score <= 10,000
Example
Input:
6
Bob 87
Mike 35
Bob 52
Jason 35
Mike 55
Jessica 99
Output:
99
Example
Input
6
Bob 87
Mike 35
Bob 52
Jason 35
Mike 55
Jessica 99
Output
99