100. Students Above Average
Core1000 ms256 MBSolved by 0%
Read n student records, each holding a name and a mark.
Print how many students scored strictly above the class average.
The average is computed exactly, not rounded, so a class of marks 1 and 2 has an average of 1.5, and one student is above it.
Constraints - `1 ≤ n ≤ 100000` - Names are 1 to 30 letters with no spaces. - `0 ≤ mark ≤ 1000`
Input
The first line contains an integer n.
Each of the next n lines contains a name and a mark.
Output
Print one integer, how many students scored strictly above the exact class average.
Input3
A 60
B 70
C 80
Output1
Notehas an average of 70, and only one student above it
Input2
A 1
B 2
Output1
Notehas a fractional average of 1.5, which rounding to 1 would get wrong
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.