#P432. 【例75.3】 谁拿了最多奖学金
【例75.3】 谁拿了最多奖学金
Description
At the end of each semester, a certain school awards scholarships. There are five types of scholarships, each with different criteria:
- Academician Scholarship: 8000 yuan per person, awarded to students whose final average score is above 80 and who have published at least 1 paper during the semester;
- May Fourth Scholarship: 4000 yuan per person, awarded to students whose final average score is above 85 and whose class evaluation score is above 80;
- Excellent Student Award: 2000 yuan per person, awarded to students whose final average score is above 90;
- Western Scholarship: 1000 yuan per person, awarded to students from western provinces whose final average score is above 85;
- Class Contribution Award: 850 yuan per person, awarded to student leaders whose class evaluation score is above 80;
A student can receive any scholarship for which they meet the criteria, and there is no limit to the number of recipients for each scholarship. Each student can receive multiple scholarships at the same time. For example, if Yao Lin's final average score is 87, class evaluation score is 82, and he is also a student leader, he can receive both the May Fourth Scholarship and the Class Contribution Award, totaling 4850 yuan.
Given the data for several students, please calculate which student(s) received the highest total scholarship amount (assume at least one student meets the criteria).
Input Format
The first line is an integer (), representing the total number of students. The next lines each contain data for one student, in the following order: name, final average score, class evaluation score, whether the student is a student leader, whether the student is from a western province, and the number of published papers. The name is a string of up to 20 uppercase and lowercase English letters (no spaces); the scores are integers from 0 to 100 (inclusive); whether the student is a leader and whether they are from a western province are indicated by a single character, for yes and for no; the number of published papers is an integer from 0 to 10 (inclusive). Each data item is separated by a space.
Output Format
Three lines: the first line is the name of the student who received the most scholarship money, the second line is the total amount they received. If there are multiple students with the highest amount, output the one who appears earliest in the input. The third line is the total amount of scholarships awarded to all students.
Sample
4
YaoLin 87 82 Y N 0
ChenRuiyi 88 78 N Y 1
LiXin 92 88 N N 0
ZhangQin 83 87 Y N 1ChenRuiyi
9000
28700