Problem
Input format
The first line contains `n`, `k`, `m`, separated by spaces. The next `n` lines each contain the student name followed by `m` grades, separated by spaces. - `1 <= n <= 300` - `1 <= k <= 300` - `1 <= m <= 4` - grades are integers between `1` and `10` - the name has at most `30` characters and contains no spaces - use of `strcmp` and `strcpy` (from `<cstring>`) is permitted
Output format
At most `k` lines (or `n`, if `n < k`), each containing a student name and their average with two decimal places, separated by a space, in the required order.
Example
5 3 3 Maria 8 9 10 Ion 7 7 7 Ana 10 10 9 Dan 9 9 9 Elena 6 6 6
Ana 9.67 Dan 9.00 Maria 9.00
Stuck?
Use the Get Hint button in the action bar to reveal a guided hint.
💬 Discussion
Loading...No comments yet. Be the first to start the discussion!
Sample cases (from the problem)
Sample Case 1
5 3 3 Maria 8 9 10 Ion 7 7 7 Ana 10 10 9 Dan 9 9 9 Elena 6 6 6
Ana 9.67 Dan 9.00 Maria 9.00
Solve it your way first
Community solutions unlock after you submit a passing solution. Don't peek.
Ready to solve this challenge?
Create a free account to write code, submit solutions, and track your progress.