#B4078. Count of Courses Meeting Class Average
Count of Courses Meeting Class Average
Count of Courses Meeting Class Average
There are \(n\) students taking an exam comprising \(m\) courses. After the exam, the teacher wants to know for each student: in how many courses did the student achieve a score that is greater than or equal to the course's class average? The average score for course \(j\) is given by \(\text{Average}_j = \frac{\sum_{i=1}^{n} s_{i,j}}{n}\). A student's score in course \(j\) is counted if \(s_{i,j} \geq \text{Average}_j\).
inputFormat
The first line contains two integers \(n\) and \(m\) representing the number of students and the number of courses respectively. Each of the following \(n\) lines contains \(m\) integers, where the \(j\)-th integer of the \(i\)-th line indicates the score \(s_{i,j}\) of the \(i\)-th student in the \(j\)-th course.
outputFormat
Output exactly \(n\) lines. The \(i\)-th line should contain a single integer representing the number of courses for which the \(i\)-th student's score is at least the class average for that course.
sample
3 4
70 80 90 100
60 70 80 90
80 85 90 95
4
0
4
</p>