33OJ
登录 注册

#P17895. [ICPC 2026 Nanchang I] BABA BOOEY

    ID: 20631 远端评测题 2000ms 1024MiB 尝试: 0 已通过: 0 显示难度普及+/提高− 上传者: 标签>江西ICPC2026省赛/邀请赛

[ICPC 2026 Nanchang I] BABA BOOEY

Problem Description

Alice and Bob take turns playing a game, with Alice going first. Before the first move, there is an array of non-negative integers a1,a2,⋯ ,ana_1,a_2,\cdots ,a_n of length nn, along with a positive integer kk. In each move, the current player chooses two integers x,yx,y such that 0≤x≤k0 \le x \le k, 1≤y≤n1 \le y \le n, and x≤ayx \le a_y. Then, kk is updated to xx, and aya_y is updated to ay−xa_y - x. A player who chooses x=0x = 0 loses immediately. Who has the winning strategy?

Input Format

There are multiple test cases. The first line contains an integer tt (1≤t≤1051 \le t \le 10^5) --- the number of test cases.

For each test case:

The first line contains two integers nn and kk (1≤n≤1061 \le n \le 10^6, 1≤k≤1091 \le k \le 10^9).

The second line contains nn integers a1,a2,…,ana_1, a_2, \ldots, a_n (0≤ai≤1090 \le a_i \le 10^9).

It is guaranteed that the sum of nn over all test cases in a single input file does not exceed 2×1062\times 10^6.

Output Format

For each test case, output a single string on a new line.

If the first player (Alice) has a winning strategy for the game described, output “Alice”; otherwise, output “Bob”.

3
2 2
1 2
4 5
15 15 8 9
11 2
4 2 9 12 0 15 9 14 5 6 12
Alice
Alice
Bob

Hint

In the first test case, the only winning first moves for Alice are (x,y)=(1,1)(x,y)=(1,1) and (x,y)=(1,2)(x,y)=(1,2).