Good Messages
Time limit1sMemory limit1024 MB
Applies a Caesar shift to a message up to N times and counts steps where vowels (including y) are at least half the consonants, printing Boris or Colleague.
- Level
Easy2 of 10
- Topics
- String, Simulation
- Solved
- No attempts yet
Problem
Boris works at a secret communication station for the government, where he trains new employees to encode messages. Messages here are encoded with a rotation (Caesar) cipher, which replaces each letter with the letter a set offset away in the alphabet. For example, with offset , 'a' becomes 'c' and 'y' becomes 'a'. To encode a message, the cipher may be applied more than once. Each application counts as one step.
Boris teaches new employees by demonstrating each step individually. He does not like a message that has at least half as many vowels as consonants after an encoding step. He counts 'a', 'e', 'i', 'o', 'u', and 'y' as vowels. Each such step makes him more annoyed.
Your job is to encode a given message and determine whether Boris sees fewer annoying steps than non-annoying ones. Since Boris wants to be happy at his job, he gives any message that annoys him too much to a colleague.
Input
The first line contains an integer (), the offset of the rotation cipher. The second line contains the message, which consists only of lowercase English letters. Its length is between and characters. The third line contains an integer (), the number of times the cipher is applied.
Output
Print 'Boris' if the number of steps that do not annoy him is strictly greater than the number of steps that do. Otherwise, print 'Colleague'.