Topic links: https://www.luogu.org/problem/P4860
and "P4018 Roy & October to take the stone," as the derivation of ideas, go cycling festival.
It can be found: as long as the win is not divisible by four states, as long as the losing state is divisible by four.
Codes are as follows:
#include <bits/stdc++.h>
using namespace std;
int T, n;
int main() {
cin >> T;
while (T --) {
cin >> n;
puts( n % 4 ? "October wins!" :"Roy wins!" );
}
return 0;
}