Hello,
Can someone explain the logic to solve this problem?
https://csacademy.com/contest/round-64/task/limited-moves/
Consider a heap of N objects. Two players take turns playing the following game:
At his very first move, the first player removes from the heap between 1 and N-1 objects After that, at each step the player to move can remove any number of objects between 1 and the number of objects removed by the other player at the previous move When the heap becomes empty, the player to move loses the game.