#P1051. [NOIP 2005 提高组] 谁拿了最多奖学金
[NOIP 2005 提高组] 谁拿了最多奖学金
Description
It is customary at this school to award scholarships after each semester’s final exams. There are five types of scholarships, each with different requirements:
- Academician Scholarship: yuan per person. Students whose final average score is greater than () and who have published or more papers during this semester are eligible.
- May Fourth Scholarship: yuan per person. Students whose final average score is greater than () and whose class evaluation score is greater than () are eligible.
- Outstanding Performance Award: yuan per person. Students whose final average score is greater than () are eligible.
- Western Scholarship: yuan per person. Students from western provinces whose final average score is greater than () are eligible.
- Class Contribution Award: yuan per person. Student cadres whose class evaluation score is greater than () are eligible.
As long as the conditions are met, the scholarship will be awarded. There is no limit on the number of recipients for each scholarship, and each student may receive multiple scholarships simultaneously. For example, if Yao Lin’s final average score is and the class evaluation score is , and he is also a student cadre, then he can receive both the May Fourth Scholarship and the Class Contribution Award, for a total of yuan.
Now, given data for several students, calculate which student(s) received the highest total amount of scholarship money (assume there is always at least one student who meets some scholarship condition).
Input Format
The first line contains integer , the total number of students.
Each of the following lines contains one student’s data, in order: name, final average score, class evaluation score, whether the student is a student cadre, whether the student is from a western province, and the number of published papers. The name is a string of uppercase and lowercase English letters with length at most (no spaces). The final average score and the class evaluation score are integers between and (inclusive). Whether the student is a student cadre and whether the student is from a western province are each represented by character: means yes, and means no. The number of published papers is an integer between and (inclusive). Each pair of adjacent data items is separated by a single space.
Output Format
Output lines.
- Line : the name of the student who received the most scholarship money. If two or more students tie for the most, output the one who appears earliest in the input.
- Line : the total amount of scholarship money this student received.
- Line : the total amount of scholarship money received by all students.
4
YaoLin 87 82 Y N 0
ChenRuiyi 88 78 N Y 1
LiXin 92 88 N N 0
ZhangQin 83 87 Y N 1
ChenRuiyi
9000
28700
Hint
Constraints
For of the testdata, .
Problem Source
NOIP 2005 Senior, Problem 1.
Translated by ChatGPT 5
京公网安备 11011102002149号