Official algorithmic problem description and constraints.
Alice and Bob play a game on a pile of N stones.
In her turn, Alice can remove at least one and at most A stones while Bob can remove at least one and at most B stones on his turn.
The person who takes the last stone wins.
Predict the winner of the game if Alice goes first (and turns alternate) under optimal play from both players.
Detailed video explanations, mathematical intuition, and clean C++ implementation code.