are given one number t (1≤t≤104) — the number of test cases. The following 2⋅t
lines contain test cases.
The first line of each test case contains three numbers n
, x, y (1≤n≤105, 0≤x≤109, 0≤y≤1015) — the length of array a, Alice's initial number (Bob's initial number is therefore x+3), and the number that one of the two friends got in the end.
The second line of each test case contains n
numbers — the array a (0≤ai≤109).It is guaranteed that the sum of n
over all test cases does not exceed 105.
Output
For each test case, print the name of the friend who could get the number y
: "Alice" or "Bob".
Example
Input
Copy
4 1 7 9 2 2 0 2 1 3 4 0 1 1 2 3 4 2 1000000000 3000000000 1000000000 1000000000Output
Copy
Alice Alice Bob AliceNote
In the first test case, Alice could get 9
using the following operations: 7+2=9.
In the second test case, Alice could get 2
using this operations: (0+1)⊕3=2.
In the third test case, Bob started with x+3=0+3=3
and could get 1 this way: (((3+1)+2)⊕3)⊕4=1.
解题思路:
题目给了两种操作:+ and ⊕
可以得出两种操作结束后不会改变其奇偶性
题目说A~是 x
B~是x+3
那么我们可以最大最后两者奇偶性一定不相同
又因为题目说一定有答案,不是A~就是B~
那么我们可以通过奇偶性来判断答案
AC代码如下:
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <cstdio>
#include <map>
#define ll long long
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 1e5 + 5;
int s[N];
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
ll n,x,y;
scanf("%lld %lld %lld",&n,&x,&y);
for(int i = 1;i<=n;i++)
{
int t;
scanf("%d",&t);
x+=t;
}
if((x&1)==(y&1))
printf("Alice\n");
else
printf("Bob\n");
}
}