Olympiad Maths Prep

Track / Stage 6 / 375 of 400 #1375 of 2000

Problem 1375

National olympiad, first round
Combinatorics Difficulty 6.9 Find the answer

Positive integers nn, k>1k>1 are given. Pasha and Vova play a game on a board n×kn\times k. 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.

Official solution

1. Understanding the Problem:
- We have a board of size n×k n \times k .
- 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 n+k2 n + k - 2 borders. This is because the path must move n1 n-1 steps up and k1 k-1 steps to the right, totaling n+k2 n + k - 2 steps.

3. Total Number of Borders:
- The total number of borders that can be placed on the board is n(k1)+k(n1) n(k-1) + k(n-1) . This is because:
- There are n n rows, each with k1 k-1 horizontal borders.
- There are k k columns, each with n1 n-1 vertical borders.
- Simplifying, we get:
n(k1)+k(n1)=nkn+knk=2nknk n(k-1) + k(n-1) = nk - n + kn - k = 2nk - n - k

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:
(n(k1)+k(n1))mod2=(nkn+knk)mod2=(2nknk)mod2 (n(k-1) + k(n-1)) \mod 2 = (nk - n + kn - k) \mod 2 = (2nk - n - k) \mod 2
- Since 2nk 2nk is always even, we have:
(2nknk)mod2=(n+k)mod2 (2nk - n - k) \mod 2 = (n + k) \mod 2

5. Determining the Winning Strategy:
- If n+k n + k is even, then the total number of borders is even.
- If n+k n + k 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 n+k n + k is even, the first player (Pasha) will place the last border.
- If n+k n + k 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 n+k n + k is even, the second player (Vova) wins.
- If n+k n + k is odd, the first player (Pasha) wins.

The final answer is the second player (Vova) will win if n+k \boxed{ n + k } is even, and the first player (Pasha) will win if n+k n + k is odd.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.