← 返回 goldmansachs 的题目列表Best Average Score
类型:online_judge
Problem: Best Average Score
You are given several student exam records. Each record contains a student's name and one exam score. A student may appear multiple times.
Compute the average score for each student, and return the highest average score among all students. If an average is not an integer, return its floor as an integer.
Input Format
The first line contains an integer n, the number of exam records.
The next n lines each contain a string name and an integer score.
Output Format
Print one integer: the highest average score rounded down.
Constraints
1 <= n <= 10^5
1 <= len(name) <= 50
name contains only English letters
0 <= score <= 100
Example
Input
6
Bob 87
Mike 35
Bob 52
Jason 35
Mike 55
Jessica 99
Output
99
Explanation
Bob's average is (87 + 52) / 2 = 69.5, floored to 69
Mike's average is (35 + 55) / 2 = 45
Jason's average is 35
Jessica's average is 99
The highest average score is 99.
Example
Input
6
Bob 87
Mike 35
Bob 52
Jason 35
Mike 55
Jessica 99
Output
99