問題一覧 > 通常問題

No.2476 Knight Game

レベル : / AI推定難易度 : 2500 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 12
作問者 : nok0 / テスター : akakimidori りあん tsutaj beet 👑 tute7627 SPD_9X2 👑 rin204 だれ momoyuu KKT89
お気に入りにしたユーザー ProblemId : 10099 / 自分の提出
問題文最終更新日: 2023-09-17 20:46:52
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Japan Alumni Group Summer Camp 2023 Day 2 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。