Positive integers , are given. Pasha and Vova play a game on a board . Pasha begins, and further they alternate the following moves. On each move a player should place a border of length 1 between two adjacent cells. The player loses if after his move there is no way from the bottom left cell to the top right without crossing any order. Determine who of the players has a winning strategy.
Problem 1375
Official solution
1. Understanding the Problem:
- We have a board of size .
- Pasha and Vova take turns placing a border of length 1 between two adjacent cells.
- The player loses if after their move there is no way from the bottom left cell to the top right cell without crossing any border.
2. Analyzing the Path:
- Any path from the bottom left cell to the top right cell will cross borders. This is because the path must move steps up and steps to the right, totaling steps.
3. Total Number of Borders:
- The total number of borders that can be placed on the board is . This is because:
- There are rows, each with horizontal borders.
- There are columns, each with vertical borders.
- Simplifying, we get:
4. Parity Consideration:
- We need to consider the parity (odd or even nature) of the number of borders.
- The total number of borders modulo 2 is:
- Since is always even, we have:
5. Determining the Winning Strategy:
- If is even, then the total number of borders is even.
- If is odd, then the total number of borders is odd.
- The game ends when there are no more valid moves, i.e., when the last border is placed.
- If is even, the first player (Pasha) will place the last border.
- If is odd, the second player (Vova) will place the last border.
6. Conclusion:
- The player who places the last border loses because they will block the path from the bottom left to the top right cell.
- Therefore, if is even, the second player (Vova) wins.
- If is odd, the first player (Pasha) wins.
The final answer is the second player (Vova) will win if is even, and the first player (Pasha) will win if is odd.