LCC '24 Contest 2 J2 - Hiring Helpers

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

Eric is currently hiring a new group of N people to rake leaves! Each person i has their own ranking a_i (1 \le a_i \le 100). He wants to know how many people are qualified (have a ranking of at least 50), and whether at least half of the people are qualified. However, since he isn't the greatest programmer, he turns to you for help!

Input Specification

The first line of input will contain one integer N (1 \le N \le 2 \times 10^5), representing the number of people in the group.

The second line of input will contain N space-separated integers a_i (1 \le a_i \le 100), representing the i^{th} person's ranking.

Output Specification

On the first line, output the integer representing the number of people who are qualified.

On the second line, output YAY if at least half the people are qualified, and NOO if not.

Sample Input 1

3
1 50 100

Sample Output 1

2
YAY

Sample Input 2

5
1 1 1 100 100

Sample Output 2

2
NOO

Comments

There are no comments at the moment.