#P1051. Highest Scholarship Award
Highest Scholarship Award
Highest Scholarship Award
In this problem, each student can receive multiple scholarships based on their academic and extracurricular performance. The scholarships and their conditions are as follows:
- Academician Scholarship: Award (8000) if the student has a final exam score greater than (80) and has published at least one paper.
- May Fourth Scholarship: Award (4000) if the student has a final exam score greater than (85) and a class review score greater than (80).
- Excellent Scholarship: Award (2000) if the student has a final exam score greater than (90).
- Western Scholarship: Award (1000) if the student is from a western province and has a final exam score greater than (85).
- Class Contribution Award: Award (850) if the student is a student cadre and has a class review score greater than (80).
A student may qualify for several scholarships simultaneously. Given the data for (n) students, determine which student(s) receive the highest total scholarship amount. If multiple students tie for the highest award, output their names in the order they appear in the input.
Example: If a student named Yao Lin has a final exam score of (87), a class review score of (82), and is a student cadre, they will be eligible for the May Fourth Scholarship ((4000)) and the Class Contribution Award ((850)), with a total of (4850).
inputFormat
The input begins with an integer (n) ((n \geq 1)), the number of students. Each of the following (n) lines contains information for one student in the following format:
Name FinalScore ClassReviewScore NumPapers Province CadreFlag
where:
- Name is a string without spaces.
- FinalScore and ClassReviewScore are floating-point numbers.
- NumPapers is an integer that denotes the number of papers published.
- Province is a string; use "west" to denote a western province and any other string for non-western provinces.
- CadreFlag is a character: 'Y' indicates the student is a student cadre and 'N' indicates they are not.
outputFormat
The output consists of two lines:
- The first line prints the name(s) of the student(s) who have received the highest total scholarship, separated by a single space if there are multiple.
- The second line prints the highest total scholarship amount as an integer.
sample
4
Alice 87 82 0 east Y
Bob 92 81 1 west N
Charlie 75 85 2 east N
David 88 90 1 west Y
Bob
15000
</p>