CF1634B.Fortune Telling

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Haha, try to solve this, SelectorUnlimited!

— antontrygubO_o

Your friends Alice and Bob practice fortune telling.

Fortune telling is performed as follows. There is a well-known array aa of nn non-negative integers indexed from 11 to nn . The tellee starts with some non-negative number dd and performs one of the two operations for each i=1,2,,ni = 1, 2, \ldots, n , in the increasing order of ii . The possible operations are:

  • replace their current number dd with d+aid + a_i
  • replace their current number dd with daid \oplus a_i (hereinafter \oplus denotes the bitwise XOR operation)

Notice that the chosen operation may be different for different ii and for different tellees.

One time, Alice decided to start with d=xd = x and Bob started with d=x+3d = x + 3 . Each of them performed fortune telling and got a particular number in the end. Notice that the friends chose operations independently of each other, that is, they could apply different operations for the same ii .

You learnt that either Alice or Bob ended up with number yy in the end, but you don't know whose of the two it was. Given the numbers Alice and Bob started with and yy , find out who (Alice or Bob) could get the number yy after performing the operations. It is guaranteed that on the jury tests, exactly one of your friends could have actually gotten that number.

Hacks

You cannot make hacks in this problem.

输入格式

On the first line of the input, you are given one number tt ( 1t1041 \le t \le 10^4 ) — the number of test cases. The following 2t2 \cdot t lines contain test cases.

The first line of each test case contains three numbers nn , xx , yy ( 1n1051 \le n \le 10^5 , 0x1090 \le x \le 10^9 , 0y10150 \le y \le 10^{15} ) — the length of array aa , Alice's initial number (Bob's initial number is therefore x+3x+3 ), and the number that one of the two friends got in the end.

The second line of each test case contains nn numbers — the array aa ( 0ai1090 \le a_i \le 10^9 ).

It is guaranteed that the sum of nn over all test cases does not exceed 10510^5 .

输出格式

For each test case, print the name of the friend who could get the number yy : "Alice" or "Bob".

输入输出样例

  • 输入#1

    4
    1 7 9
    2
    2 0 2
    1 3
    4 0 1
    1 2 3 4
    2 1000000000 3000000000
    1000000000 1000000000

    输出#1

    Alice
    Alice
    Bob
    Alice

说明/提示

In the first test case, Alice could get 99 using the following operations: 7+2=97 + 2 = 9 .

In the second test case, Alice could get 22 using this operations: (0+1)3=2(0 + 1) \oplus 3 = 2 .

In the third test case, Bob started with x+3=0+3=3x+3 = 0+3=3 and could get 11 this way: (((3+1)+2)3)4=1(((3 + 1) + 2) \oplus 3) \oplus 4 = 1 .

首页