#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:

  1. Academician Scholarship: 80008000 yuan per person. Students whose final average score is greater than 8080 (>80>80) and who have published 11 or more papers during this semester are eligible.
  2. May Fourth Scholarship: 40004000 yuan per person. Students whose final average score is greater than 8585 (>85>85) and whose class evaluation score is greater than 8080 (>80>80) are eligible.
  3. Outstanding Performance Award: 20002000 yuan per person. Students whose final average score is greater than 9090 (>90>90) are eligible.
  4. Western Scholarship: 10001000 yuan per person. Students from western provinces whose final average score is greater than 8585 (>85>85) are eligible.
  5. Class Contribution Award: 850850 yuan per person. Student cadres whose class evaluation score is greater than 8080 (>80>80) 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 8787 and the class evaluation score is 8282, 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 48504850 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 11 integer NN, the total number of students.

Each of the following NN 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 2020 (no spaces). The final average score and the class evaluation score are integers between 00 and 100100 (inclusive). Whether the student is a student cadre and whether the student is from a western province are each represented by 11 character: Y\tt Y means yes, and N\tt N means no. The number of published papers is an integer between 00 and 1010 (inclusive). Each pair of adjacent data items is separated by a single space.

Output Format

Output 33 lines.

  • Line 11: 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 22: the total amount of scholarship money this student received.
  • Line 33: the total amount of scholarship money received by all NN 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 100%100\% of the testdata, 1N1001 \le N \le 100.

Problem Source

NOIP 2005 Senior, Problem 1.

Translated by ChatGPT 5