-->
当前位置:首页 > 题库

PROGRAMMING:Hall of fame and voucher

Luz5年前 (2021-05-10)题库440
For MOOC in Chinese Universities( http://www.icourse163.org/ )Students who study "data structure" course, want to get a certificate, the total score must reach 60 points or above, and there are additional benefits: the total score in the [g, 100] range, can get 50 yuan pat voucher; In the [60, g) range, you can get 20 yuan pat voucher. It is generally used in national examination centers and is valid for one year. At the same time, the teacher will also include the top k students in the course "Hall of fame". Please write a program to help the teacher list the hall of fame students, and count the total face value of Pat vouchers.
###Input format:
Enter three integers in the first line, which are n (positive integer no more than 10000, for the total number of students), G (integer in the (60100) range, for the voucher level boundary described in the topic surface), K (positive integer no more than 100 and no more than N, for the lowest place to enter the hall of fame). Next N lines, each line gives a student's account number (a string with no more than 15 digits and no spaces) and total score (an integer in the interval [0, 100]), separated by spaces. The title guarantees that there are no duplicate accounts.
###Output format:
First, output the total face value of the issued pat vouchers in one line. Then, the ranking, account number and score of the students entering the hall of fame will be output in non ascending order according to the total score, separated by a space. It should be noted that: students with the same score enjoy a parallel ranking. When the ranking is parallel, it is output in ascending order according to the alphabetic order of the account number.
###Input example:
```in
10 80 5
cy@zju.edu.cn seventy-eight
cy@pat-edu.com eighty-seven
1001@qq.com sixty-five
uh-oh@163.com ninety-six
test@126.com thirty-nine
anyone@qq.com eighty-seven
zoe@mit.edu eighty
jack@ucla.edu eighty-eight
bob@cmu.edu eighty
ken@163.com seventy
```
###Output example:
```out
three hundred and sixty
one uh-oh@163.com ninety-six
two jack@ucla.edu eighty-eight
three anyone@qq.com eighty-seven
three cy@pat-edu.com eighty-seven
five bob@cmu.edu eighty
five zoe@mit.edu eighty
```







answer:If there is no answer, please comment