#P6427. Mock Exam
Mock Exam
Mock Exam
Adrian, Bruno, and Goran want to join the birdwatchers club but they cannot tell the birds apart. The club exam consists of \( n \) multiple choice questions with three possible answers each: A, B, and C.
Since they are clueless, each person uses his own fixed guessing pattern:
- Adrian's pattern: A, B, C, A, B, C, ...
- Bruno's pattern: B, A, B, C, B, A, B, C, ...
- Goran's pattern: C, C, A, A, B, B, C, C, A, A, B, B, ...
Write a program that, given the correct answers, determines who gets the most answers right. Output the highest score on the first line, and then output the names of the persons achieving that score in alphabetical order, each on a new line.
inputFormat
The input consists of:
- An integer \( n \) (\( 1 \le n \le 100 \)), the number of questions.
- A string of length \( n \) consisting only of the characters 'A', 'B', and 'C', representing the correct answers.
outputFormat
Output the highest score on the first line. Then output the names of the candidate(s) whose answer count equals the highest score, one on each line in alphabetical order.
sample
5
BAACC
3
Bruno
</p>