#P4018. Roy&October之取石子
Roy&October之取石子
Description
The rules are as follows: There are stones in total. On each turn, a player may take exactly stones ( is a prime, is a natural number, and is less than or equal to the current remaining number of stones). Whoever takes the last stone wins.
October moves first. Determine whether she has a winning strategy.
If she has a winning strategy, output a line October wins!; otherwise, output a line Roy wins!.
Input Format
The first line contains a positive integer , the number of test cases.
From line to line , each line contains a positive integer , the number of stones.
Output Format
lines, each being either October wins! or Roy wins!.
3
4
9
14
October wins!
October wins!
October wins!
Hint
For of the testdata, . For of the testdata, . For of the testdata, , .
(Adapted problem).
Translated by ChatGPT 5
京公网安备 11011102002149号