Top highest GPA

Xem dạng PDF

Gửi bài giải

Điểm: 1,00 (OI)
Giới hạn thời gian: 1.0s
Giới hạn bộ nhớ: 256M
Input: stdin
Output: stdout

Nguồn bài:
Hà Minh Ngọc
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Given a list of ~n~ students with the following informationStudent ID (a ~10~-digit integer). Student name (including lowercase letters, no spaces, no more than ~20~ characters). Number of subjects (integer, not more than ~100~). Highest score of all subjects (non-negative integer and not more than ~100~). Accordingly, the average score is calculated on subjects with scores of not less than ~50~. Each subject is equivalent to ~4~ credits. Output a list of no more than ~k~ students with the highest GPA.

Given a list of ~n~ students with the following information

  • Student ID (a ~10~-digit integer).
  • Student name (including lowercase letters, no spaces, no more than ~20~ characters).
  • Number of courses(integer, no more than ~100~).
  • Highest score of all courses(non-negative integer and no more than ~100~). Accordingly, the average score is calculated on courses with scores of not less than ~50~. Each course is equivalent to ~4~ credits.

Output a list of no more than ~k~ students with the highest GPA.

Input:

  • The first line is the number of students ~n (0 < n ≤ 10^5)~ and the integer ~k (0 < k ≤ n)~.

  • Each line in the next ~n~ lines contains information about a student, student id, name, course number, and course grades.

Output:

Output the list as required, per student per line of student ID, name, GPA rounded to units, and number of credits. The list of students appears in descending order of grades (unrounded score), if the scores are equal, then students should be in the order entered. If two students have the same score, they should be both outputed or none of them is outputed.

Example Input

3 2
1131209131 phung 4 100 90 80 60
1131200010 phong 3 60 50 40
1131200001 vinh 4 50 60 60 50

Example Output

1131209131 phung 83 16

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.