#K40577. Calculate Student Scores
Calculate Student Scores
Calculate Student Scores
You are given n students and m tests. For each test, the scores of all students are provided in a single line. Your task is to compute for each student:
- The total score: \( T_i = \sum_{j=1}^{m} s_{ji} \), where \(s_{ji}\) is the score of the \(i^{th}\) student in the \(j^{th}\) test.
- The average score: \( A_i = \frac{T_i}{m} \). The average must be rounded to two decimal places.
The student IDs are numbered from 1 to n. Print the result for each student on a separate line in the following format:
student_id total_score average_score
inputFormat
The first line contains two space-separated integers n and m where n is the number of students and m is the number of tests. This is followed by m lines, each containing n integers. Each line represents the scores of all n students in one test.
outputFormat
Output n lines. Each line contains three values separated by spaces: the student ID (starting at 1), the total score, and the average score (rounded to two decimal places).
## sample3 2
50 60 70
80 90 100
1 130 65.00
2 150 75.00
3 170 85.00
</p>