P15715 [JAG 2023 Summer Camp #2] Knight Game
Description
The rule of this game is given as follows.
- There is a knight and a chessboard with $H$ rows and $W$ columns. The square at the $i$-th row from the top and the $j$-th column from the left is called square $(i, j)$. Initially, the knight is placed on square $(x, y)$.
- Alice and Bob alternately take the following action, starting with Alice.
- Move the knight onto one of the unvisited squares according to the knight's movement.
- Knights can move from $(x_1, y_1)$ to $(x_2, y_2)$ if and only if $(x_1 - x_2)^2 + (y_1 - y_2)^2$ is $5$.
- The player who cannot move the knight is the loser.
When both players have done their best, determine whether Alice or Bob will win. Answer for $T$ test cases.
The unvisited square is defined as follows.
- A square on the board that the knight has never visited since the beginning of the game.
Input Format
$$
\begin{aligned}
&T \\
&case_1 \\
&\vdots \\
&case_T
\end{aligned}
$$
$case_i$ represents the $i$-th test case.
Each test case is given in the following format.
$$H \ W \ x \ y$$
The input satisfies the following constraints.
- All inputs consist of integers.
- $1 \leq T \leq 2 \times 10^5$
- $1 \leq H, W \leq 10^9$
- $1 \leq x \leq H$
- $1 \leq y \leq W$
Output Format
Output $T$ lines. On the line $i$, answer the winner of the $i$-th test case, Alice or Bob.