Game of Coins

3.5

2 votes
Easy
Problem

Alice and Bob are playing a game. They have N coin piles, where the ith coin pile consists of A[i] coins initially.

In addition, Alice and Bob have also been given some integer X. In a single move, a player can choose a single pile i (1iN) and withdraw any number of coins between 1 and min(A[i],X) both inclusive from that pile.

Let's call the number of coins they withdraw in a move to be Y. After such a move, the number of coins in pile i reduces by Y. That is , A[i] transforms to A[i]Y.

Alice and Bob take turns in playing this game, starting with Alice. The first player who is unable to make a valid move loses, and the other player wins the game.

Given a state of the game, and considering that both Alice and Bob play optimally, you need to find out the winner of the game.

Print "Alice" ( without quotes ) if Alice wins, else print "Bob" (without quotes) .

Input Format :

The first line consists of a single integer T denoting the number of test-cases in a single test file.

The first line of each test case consists of a 2 space separated integers N and X. The next line consists of N space separated integers, where the ith integer denotes A[i].

Output Format :

For each test case, print the winner of the game on a new line.

Constraints :

1T10

1N105

1A[i],X109 .

Sample Input
1
3 10
1 2 3
Sample Output
Bob
Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

If Bob plays optimally, any possible sequence of moves by Alice shall only lead to a loss.

Editor Image

?