Submit | All submissions | Best solutions | Back to list |
EITOPK - Top highest GPA |
Given the list of N students. For each student, given the number of courses that student finished and scores of these courses. Calculate and print out at most K students that had highest GPA (grade point average). Each course has 4 credits and only courses with grades larger than or equal to 50 are counted.
Input
- The first line contains two integers N (0 ≤ N ≤ 105) and K - the number of students and the largest number of students to be printed out.
- The next N lines each contains one string S, one integer M following by M integers. With S is the name of student (non-empty, lowercase letter, no space character, length does not exceed 20). M is the number of courses that student had and M following integers are the scores (the score does not excceed 100).
Output
Print out at most K students, sorted by descending GPA, descending total of gained credits.
For each student, print name, GPA (rounded to unit), total of gained credits separated by one space character. If two students have equal GPA and total credits, compare their names in alphabetical order.
Sample
Input |
Output |
4 3 chau 4 50 50 50 50 binh 4 60 70 80 70 an 4 60 40 80 70 duong 4 70 70 70 70 |
binh 70 16 duong 70 16 an 70 12 |
Added by: | Ha Minh Ngoc |
Date: | 2019-11-08 |
Time limit: | 1s-1.5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |