logo AlgoBeat OnlineJudge
登录 注册

#214207. [ZJCPC 2017] Yet Another Game of Stones

内存限制:64 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Alice and Bob are playing yet another game of stones. The rules of this game are as follow:

  • The game starts with piles of stones indexed from to . The -th pile contains stones and a special constraint indicated as .

  • The players make their moves alternatively. .

  • An allowable move of Bob is considered as removal of some positive number of stones from a pile.

  • An allowable move of Alice is also considered as removal of some positive number of stones from a pile, but is limited by the constraint of that pile.

    • If , there are no constraints.
    • If , Alice can only remove some odd number of stones from that pile.
    • If , Alice can only remove some even number of stones from that pile.

    Please note that there are no constraints on Bob.

  • The player who is unable to make an allowable move loses.

Alice is always the first to make a move. Do you know who will win the game if they both play optimally?

输入格式

There are multiple test cases. The first line of input contains an integer , indicating the number of test cases. For each test case:

The first line contains an integer (), indicating the number of piles.

The second line contains integers (), indicating the number of stones in each pile.

The third line of each test case contains integers (), indicating the special constraint of each pile.

It is guaranteed that the sum of over all test cases does not exceed .

We kindly remind you that this problem contains large I/O file, so it's recommended to use a faster I/O method. For example, you can use scanf/printf instead of cin/cout in C++.

输出格式

For each test case, output "Alice" (without the quotes) if Alice will win the game. Otherwise, output "Bob" (without the quotes).

样例

样例输入 1

3
2
4 1
1 0
1
3
2
1
1
2

样例输出 1

Alice
Bob
Bob

数据范围与提示

For the first test case, Alice can remove stones from the first pile, and then she will win the game.

For the second test case, as Alice can only remove some even number of stones, she is unable to remove all the stones in the first move. So Bob can remove all the remaining stones in his move and win the game.

For the third test case, Alice is unable to remove any number of stones at the beginning of the game, so Bob wins.