a652: Centauri Prime
Tags :
Accepted rate : 24人/26人 ( 92% ) [非即時]
評分方式:
Tolerant

最近更新 : 2022-03-20 17:18

Content

Alice and Bob are playing the game called Centauri Prime. Centauri Prime represents a planet which is split into several independent kingdoms. Before they start playing the game, they have to choose rulers for each kingdom. Alice and Bob mutually decided to distribute kingdoms based on the letter the kingdom's name ended with. Alice loves vowels and decided to rule kingdoms whose names ended in a vowel. Bob loves consonants and decided to rule kingdoms whose names ended in a consonant. Both of them do not like the letter 'y'(case insensitive) and thus, all kingdoms whose names ended in the letter 'y' are left without a ruler. Can you write a program that will determine the rulers of several kingdoms, given the kingdoms' names?

Input

The first line of the input gives the number of test cases, TT. TT lines follow, each one containing the name of one kingdom. Kingdom names will consist of only lower case English letters, starting with a capital letter. There will be no other characters on any line, and no empty lines.
List of vowels for this problem is ['A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u'].

Output

For each test case, output one line containing Case #xx: KK is ruled by Y.Y., where xx is the case number (starting from 1), KK is the kingdom name, and YY is either AliceBob or nobody.

Be careful with capitalization and the terminating period. Your output must be in exactly this format. See the examples below.

Sample Input #1
3
Mollaristan
Auritania
Zizily
Sample Output #1
Case #1: Mollaristan is ruled by Bob.
Case #2: Auritania is ruled by Alice.
Case #3: Zizily is ruled by nobody.
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (33%): 1.0s , <1K
公開 測資點#1 (33%): 1.0s , <1M
公開 測資點#2 (34%): 1.0s , <1M
Hint :
Tags:
出處:
[管理者:
ricky (電腦黃)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」