CF2027E1 Bit Game (Easy Version)
题目描述
### 题面
**这是这个问题的简单版本。唯一不同的是,在这个版本中,您需要输出游戏的获胜者,而且每堆棋子的数量是固定的。您必须同时解出这两个版本才能破解**。
爱丽丝和鲍勃正在玩一个熟悉的游戏,他们轮流从 $n$ 堆中取出棋子。最初,在第 $i$ 堆中有 $x_i$ 颗棋子,它的相关值为 $a_i$ 。当且仅当以下两个条件都满足时,棋手才能从第 $i$ 堆中拿走 $d$ 颗棋子:
- $1 \le d \le a_i$ ,以及
- $x \ \&\ d = d$ ,其中 $x$ 是当前第 $i$ 中的棋子数量, $\&$ 表示[位和运算](https://en.wikipedia.org/wiki/Bitwise_operation#AND)。
无法下棋的棋手输棋,爱丽丝先下。
给你每堆棋子的 $a_i$ 和 $x_i$ 值,请判断如果双方都以最佳方式下棋,谁会赢。
输入格式
每个测试包含多个测试用例。第一行包含测试用例的数量 $t$ ( $1 \le t \le 1000$ )。测试用例说明如下。
每个测试用例的第一行包含 $n$ ( $1 \le n \le 10^4$ ) - 堆数。
每个测试用例的第二行包含 $n$ 个整数 $a_1, a_2, \ldots, a_n$ ( $1 \le a_i\lt 2^{30}$ )。
每个测试用例的第三行包含 $n$ 个整数 $x_1, x_2, \ldots, x_n$ ( $1 \le x_i\lt 2^{30}$ ) 。
保证所有测试用例中 $n$ 的总和不超过 $10^4$ 。
输出格式
打印一行赢家姓名。如果 Alice 获胜,则打印 "Alice",否则打印 "Bob"(不带引号)。
### 样例解释
在第一个测试案例中,由于没有满足条件的 $d$ 值,两位棋手都无法从第一堆棋子中取出任何棋子。对于第二堆棋子,首先,爱丽丝可以取出 $1$ 和 $6$ 之间的棋子。无论爱丽丝下哪一步棋,鲍勃都可以在他的回合中取出剩下的棋子。在鲍勃下棋之后,爱丽丝再也无法下棋,因此鲍勃获胜。
在第二个测试案例中,下面是游戏可能进行的一个例子。爱丽丝先下棋,她决定从第一堆中取出棋子。她不能取走 $17$ 颗棋子,因为 $17\gt 10$ 不符合第一个条件。她不能取 $10$ 颗棋子,因为 $25 \, \& \, 10 = 8$ 不符合第二个条件。一种选择是取 $9$ 颗棋子;现在这堆棋子还剩下 $16$ 颗。轮到鲍勃时,他决定从第二堆中取石;这里唯一的选择是取走所有的 $4$ 。现在,前两堆棋子都不能再取了,所以爱丽丝必须从最后一堆中取一些棋子。她决定取 $12$ 颗棋子,然后鲍勃紧随其后,取下这堆棋子中的最后一颗 $2$ 颗棋子。由于爱丽丝现在没有合法棋步了,鲍勃获胜。由此可以看出,无论爱丽丝采用哪种策略,只要鲍勃的下法是最优的,他就总是能够获胜。
说明/提示
In the first test case, neither player can take any stones from the first pile since there is no value of $ d $ satisfying the conditions. For the second pile, to begin with, Alice can remove between $ 1 $ and $ 6 $ stones. No matter which move Alice performs, Bob can remove the rest of the stones on his turn. After Bob's move, there are no more moves that Alice can perform, so Bob wins.
In the second test case, here is one example of how the game might go. Alice moves first, and she decides to remove from the first pile. She cannot take $ 17 $ stones, because $ 17 > 10 $ , which fails the first condition. She cannot take $ 10 $ stones, because $ 25 \, \& \, 10 = 8 $ which fails the second condition. One option is to take $ 9 $ stones; now the pile has $ 16 $ stones left. On Bob's turn he decides to take stones from the second pile; the only option here is to take all $ 4 $ . Now, no more stones can be taken from either of the first two piles, so Alice must take some stones from the last pile. She decides to take $ 12 $ stones, and Bob then follows by taking the last $ 2 $ stones on that pile. Since Alice now has no legal moves left, Bob wins. It can be shown that no matter which strategy Alice follows, Bob will always be able to win if he plays optimally.