I'm asking that question because I still cannot figure out the solution after hours of thinking.
You are given two towers where first has exactly n stones and second has exactly m stones. You are also given a number k. During each round you can perform one of the actions listed below:
- take exactly k stones from the first tower,
- take exactly k stones from the second tower,
- take exactly k stones from both towers.
There are two players: A and B. Player A starts. The winner is the player who has performed last possible action. How to determine after given n, m, k numbers who has winning strategy (who will win independently from opponent moves).