Nim x Nim
CodeChefOpen on judge ↗
Gon and Killua love playing games. One day, they came across the game of [Nim](https://en.wikipedia.org/wiki/Nim), but soon got disinterested once they found the winning strategy. Thus they created a new game, “Nim x Nim”. The game is similar to single-pile Nim, except that in each turn, a player can take only 1 to $ceil(n/x)$ stones from the pile, where $n$ is the number of stones in the pile, $x
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start