#P15661. [ICPC 2025 Jakarta R] Grid Game 2×2
[ICPC 2025 Jakarta R] Grid Game 2×2
题目描述
There is a grid, with rows numbered from to and columns numbered from to . Denote as the cell at row and column .
Initially, exactly of the cells are black, and the rest are white. The -th black cell is located at .
Your childhood friends, Kita and Kami, will alternately take turns playing on this grid, with Kita moving first. A turn in the game proceeds as follows.
- Pick a black cell .
- Pick a subset where is the largest integer such that . The set may be empty.
- For each , toggle the colour of cells satisfying , , and . Toggling a colour means changing black colour to white and vice versa.
- Toggle the colour of cell . Note that the colour of cell becomes white after the toggle.
A player who is unable to play on their turn, i.e., there are no black cells anymore, loses the game, and the opposing player wins the game. If both players play optimally, determine who will win the game.
输入格式
The first line contains an integer () representing the number of black cells.
Each of the next lines contains two integers and () representing the location of the -th black cell. All the given black cells are different.
输出格式
Output one line, containing either if the first player will win the game, or otherwise.
4
1 2
1 3
2 2
2 3
Kita
1
8 8
Kita
2
2 4
4 2
Kami
提示
The first player picks the cell and the set and all the cells become white afterwards.
The first player picks the cell and the set as an empty set, and the only black cell becomes white afterwards.
The second player can always mirror the last move made by the first player.