My (seemingly correct) solution is getting WA for this problem, so I would like clarification on a few points:
The first move made by Nikifor is called Turn 1, and his opponents Turn 2 and so on, correct?
"If Nikifor wins then in the second line you must output the first turn which guarantees victory for him."
If Nikifor wins then on Turn 1 his victory is assured, thus it can be said that Turn 1 guarantees victory for him, no?
Otherwise it can not be said that Nikifor wins.
Perhaps what confuses me most is the example.
If Nikifor moves on odd turns, how can it be said that his victory is guaranteed on Turn 4?
Would it not be guaranteed on Turn 3?
Thanks, in advance.