Submit | All submissions | Best solutions | Back to list |
EIGRADU - Graduation |
As required by the training program, students must earn at least m credits to graduate(each course with a score of 50 or more will be calculated 4 credits). You are assigned to write a software to process and print a list of students eligible to graduate.
Input
The first line contains the number of students (denoted by n) and the minimum number of credits (n ≤ 106, m ≤ 250).
The i-th line in the next n lines shows the information of the ith student: student ID, student name, number of course pi and pi iintegers representing highest grade in pith course (0 ≤ pi ≤ 100).
Student ID is an integer contains no more than 10 digits; Student names include the lowercase letters and not more than 20 characters.
Output
For each student, output the student ID, student name and grade point average (only for the passed courses) separated by a space. Students are sorted in descending average score. If two students have equal GPA, the student output with the smaller student ID ifirst.
The average is rounded down to the unit.
Example
Input:
3 12
1231209122 khoa 5 45 60 50 80 40
1231209123 van 3 50 55 60
1231209124 my 3 45 60 100
Output:
1231209122 khoa 63
1231209123 van 55
Added by: | Ha Minh Ngoc |
Date: | 2017-08-21 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |