#P4018. Prime Power Stone Game
Prime Power Stone Game
Prime Power Stone Game
The game is played with n stones. Two players take turns. On each turn, a player may remove exactly \(p^k\) stones, where \(p\) is a prime number and \(k\) is a natural number (i.e., \(k \ge 1\)), and \(p^k \leq\) the current number of stones. The player who takes the last stone wins the game. Initially, October starts the game. Determine if October has a winning strategy. If she does, output a single line October wins!
; otherwise, output Roy wins!
.
inputFormat
A single integer n representing the total number of stones. (Constraint: 1 ≤ n)
outputFormat
Output a single line: October wins!
if October has a winning strategy; otherwise, output Roy wins!
.
sample
1
October wins!