Problem

Source: Estonia IMO TST 2016 p1

Tags: combinatorics, game, winning strategy



There are $k$ heaps on the table, each containing a different positive number of stones. Juri and Mari make moves alternatingly, Juri starts. On each move, the player making the move has to pick a heap and remove one or more stones in it from the table; in addition, the player is allowed to distribute any number of remaining stones from that heap in any way between other non-empty heaps. The player to remove the last stone from the table wins. For which positive integers $k$ does Juri have a winning strategy for any initial state that satisfies the conditions?