Deoilgop Game
Time limit1sMemory limit512 MB
Players alternately add 1 or double a number starting from 1, never exceeding N, and whoever writes N loses. Find the winner for each N.
- Level
Medium7 of 10
- Topics
- Game theory, Math, Recursion
- Solved
- No attempts yet
Problem
Koosaga and CubeLover want to play the Deoilgop game. The game starts with the integer 1 written on a paper, and the player who makes the number N loses.
The two players take turns. On his or her turn, a player must either add 1 to the number on the paper or multiply it by 2. The number must not exceed N. Koosaga moves first.
Determine who wins when both players play optimally.
Input
The first line contains the number of test cases (). Each of the next lines contains one integer ().
Output
For each test case, print the winner on its own line. Print "koosaga" if Koosaga wins, or "cubelover" if CubeLover wins.