Prime Power Game
Time limit1sMemory limit512 MB
Two players alternately choose a prime power p^k that divides some element and divide every element it divides by p^k; the player who cannot move loses, so print the winner.
- Level
Hard8 of 10
- Topics
- Math, Number theory, Game theory, Bit manipulation
- Solved
- No attempts yet
Problem
Koosaga and CubeLover are playing the prime power game. The game uses a sequence of length , . The two players take turns.
On each turn, the player chooses an integer and an integer . Here must be prime and must be a positive integer. Also, must divide at least one of the integers in the sequence. Then, every number in the sequence that is divisible by is divided by . The player who cannot choose and loses the game.
Write a program that determines which player wins when both players play optimally. Koosaga takes the first turn.
Input
The first line contains (), the size of the sequence. The second line contains ().
Output
If Koosaga wins, print "koosaga". If CubeLover wins, print "cubelover".