Scholarship 2

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:
Ha Minh Ngoc
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Each student is considered for a scholarship at the end of the academic year. There are three types of scholarships ~A~, ~B~ and ~C~. Know that:

  • Students who receive ~A~ scholarship must be in the group of ~1/12~ students with the highest GPA.

  • Students who receive ~B~ scholarships must be in the group of ~1/3~ students with the highest GPA and not receive scholarship A.

  • Students who receive ~C~ scholarships must be in the ~1/2~ group of students with the highest scores and not receiving scholarships A and B.

  • Students with the same GPA (not rounded off) will receive or not receive the same scholarship and the number of students who receive the scholarship will not exceed the specified rate.

  • Compute the list of students with corresponding scholarships in descending order of scores and in ascending names.

Input

  • The first line contains the number of students (denoted by ~n~) (~n~ ≤ ~10^{5}~).

  • In the next ~n~ lines, each line represents a student, including:

  • Student name (including lowercase characters and no more than 20 characters)

  • ~p~ number of student's subjects (~1~ ≤ ~p~ ≤ ~30~)

  • ~p~ integers which are the student's subject score. Guaranteed score greater than or equal to 50

Output

  • List of students, including student name, GPA and scholarship type, in order of decreasing average scores and increasing names (in alphabetical order). average scores are rounded to two decimal places

Sample Input:

14 
nam 1 56
an 1 56
ngoc 1 60
duc 1 58
khanh 1 53
vu 1 69
linh 1 50
tien 1 65
toan 2 65 64
tu 1 60
trang 1 55
son 1 55
canh 1 50
lam 1 55

Sample Output:

vu 69 A
tien 65  B
toan 64.5 B
ngoc 60 C
tu 60 C
duc 58 C

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.