No.2476 Knight Game
Problem Statement
One night, Alice and Bob are about to play a game using a chess knight piece.
The rules of this game are given below.
・There is a chessboard with $H$ rows and $W$ columns, and one knight. The square in 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)$.
・Starting with Alice, Alice and Bob alternately repeat the following operation.
☆Move the knight on the board to an unvisited square, following the way a knight moves.
・The player who first becomes unable to perform the operation loses.
Determine which of Alice and Bob wins when both play optimally. Answer for $T$ test cases.
Here, an unvisited square is defined as follows.
☆A square that exists on the board and on which the knight has never been placed since the start of the game.
The knight moves according to the rules of chess; if you are not familiar with them, please refer to the following site.
Japanese Wikipedia
Constraints
- All inputs are integers.
- $1 \le T\le 2\times 10^5$
- $1 \le H,W\le 10^9$
- $1\le x\le H$
- $1\le y\le W$
Input
$T$
$\mathrm{case}_1$
$\vdots$
$\mathrm{case}_Q$
Here, $\mathrm{case}_i$ represents the $i$-th test case.
Each test case is given in the following format.
$H$ $W$ $x$ $y$
Output
Print $T$ lines. On the $i$-th line, print Alice if Alice wins the test case on the $i$-th line, and Bob if Bob wins.
Sample
Sample 1
Input
2 4 4 1 1 9 17 7 3
Output
Alice Bob
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
nok0
akakimidori
りあん
tsutaj
beet
tute7627
SPD_9X2
だれ
momoyuu