8982: link with Chess Game

内存限制:128 MB 时间限制:1 S
题面:传统 评测方式:文本比较 上传者:
提交:2 通过:2

题目描述


There is a row of nnn cells, numbered from 111 to nnn. The uuu-th cell is called to be adjacent to the vvv-th cell if and only if ∣u−v∣=1|u-v|=1uv=1.

There are three chess pieces: red, green, and blue. The red piece is located at the rrr-th cell, the green piece is located at the ggg-th cell, and the blue piece is located at the bbb-th cell. (Different pieces may occupy the same cell.)

Alice and Bob take turns performing the following operation, with Alice going first:
  • Select a chess piece and move it to an adjacent cell (different pieces may occupy the same cell).

If, after a move, the ordered triple (r,g,b)(r, g, b)(r,g,b) formed by the positions of the three pieces has appeared at some previous moment, the player who made that move loses, and the other player wins. (The initial state is considered to have appeared before.)

Assuming both players adopt an optimal strategy, who will win the game?

输入格式

Input consists of multiple test cases.

The first line contains an integer TTT (1≤T≤1041 \leq T \leq 10^41T104), indicating the number of test cases.

Following that are TTT lines, each containing four positive integers n,r0,g0,b0n, r_0, g_0, b_0n,r0,g0,b0 (2≤n≤105,1≤r0,g0,b0≤n2 \leq n \leq 10^5, 1 \leq r_0, g_0, b_0 \leq n2n105,1r0,g0,b0n). These represent a query, where r0,g0,b0r_0, g_0, b_0r0,g0,b0 are the initial positions of the red, green and blue chess pieces, respectively.

It is guaranteed that ∑n≤106\sum n \leq 10^6n106.

输出格式

For each test case, if Alice wins, please output “Alice”; otherwise, please output “Bob”.

输入样例 复制

2
2 2 2 2
3 3 3 3

输出样例 复制

Alice
Bob

分类标签