B. Fortune Telling

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 1000000000

Output

Copy

Alice
Alice
Bob
Alice

Note

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");
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Joanh_Lan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值