Suppose there are n (n <= 50) students in a class, and each person tests m (m <= 5) courses. Find the average grade of each student and the average grade of each course, and output the scores of each subject greater than or equal Average number of students.
The input data has multiple test instances. The first line of each test instance includes two integers n and m, which represent the number of students and the number of courses, respectively. Then there are n rows of data, each row contains m integers (ie: test scores).
For each test instance, output 3 rows of data. The first row contains n data, which represents the average grade of n students, with two decimal places in the result. The second row contains m data, which represents the average grade of m courses. Results Keep two decimal places; the third line is an integer that indicates the number of students in each class whose grades are greater than or equal to the average grade.
Each test instance is followed by a blank line.
1 | 2 2 |
1 | 7.50 15.00 |
This problem is very disgusting. No tricks but you need to be very careful or you will not be able to make it.
Every time I write this problem, I need to WA many many to get one AC.
I’ve tried to count the average while inputting. However I don’t know what’s wrong because all my own test cases are right but gets WA always. So I change in the complex way.
1 |
|