#K45072. Count Students with Average Score Above Threshold
Count Students with Average Score Above Threshold
Count Students with Average Score Above Threshold
This problem requires you to determine the number of students whose average score is strictly greater than a given threshold. For each student, the average is calculated by dividing the sum of their scores by the number of scores. Mathematically, the average score for a student is given by \( \text{avg} = \frac{\sum_{i=1}^{k} s_i}{k} \), where \(s_i\) is the score and \(k\) is the total number of scores.
You are provided with the number of students and a threshold score. Each student's record consists of their name and exactly three scores. Your task is to count the number of students whose average score is strictly greater than the threshold.
For example, if a student has scores of 85, 90, and 78, then their average is \(\frac{85+90+78}{3} \approx 84.33\). If the threshold is 80, since \(84.33 > 80\), this student should be counted.
inputFormat
The input is read from STDIN and has the following format:
- The first line contains two integers \(n\) and \(t\), where \(n\) represents the number of students and \(t\) is the threshold score.
- Each of the following \(n\) lines contains a student's record. Each record consists of the student's name (a string without spaces) followed by exactly three integers representing the student's scores.
outputFormat
Output a single integer to STDOUT which is the count of students whose average score is strictly greater than \(t\).
## sample3 80
Alice 85 90 78
Bob 70 65 80
Charlie 90 95 100
2
</p>