#P6850. Team Qualification
Team Qualification
Team Qualification
Little L is not good at arithmetic. He has provided you with his score for each problem along with his team type. Your task is to determine whether he qualifies for the team based on the final score computed as follows:
- The base written exam score is 50. For each passed problem (a problem with a score > 0), add 1 point. In formula, the written score is given by: $$50+\#\{\text{problems with score}>0\}.$$
- The actual score is the sum of all the problem scores plus the written exam score. That is, if the scores are \(a_1,a_2,\dots,a_n\), then the actual score is: $$a_1+a_2+\cdots+a_n+50+\#\{\text{passed problems}\}.$$
- If the team type is A, add an additional bonus of 5 points to the actual score.
Little L qualifies for the team if his final score is at least 60. Otherwise, he does not qualify.
inputFormat
The input consists of three lines:
- The first line contains an integer \(n\) representing the number of problems.
- The second line contains a string indicating the team type (for example, "A").
- The third line contains \(n\) space-separated integers, where the \(i\)-th integer represents the score Little L obtained on the \(i\)-th problem.
outputFormat
Output a single line containing YES if Little L qualifies for the team (i.e. his final score is at least 60), or NO otherwise.
sample
2
B
10 0
YES