Graduation

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

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~ ≤ ~10^{6}~, ~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 ~p_i~ and ~p_i~ iintegers representing highest grade in pith course (~0~ ≤ ~p_i~ ≤ ~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.

Sample Input:

3 12
1231209122 khoa 5 45 60 50 80 40 
1231209123 van 3 50 55 60
1231209124 my 3 45 60 100 

Sample Output:

1231209122 khoa 63
1231209123 van 55

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.