#C2902. Winning the Candy Game

    ID: 46270 Type: Default 1000ms 256MiB

Winning the Candy Game

Winning the Candy Game

Alice and Bob are playing a candy game. There are N candies on the table. In each turn, a player may take between 1 and K candies. Alice always starts first. The player who takes the last candy wins the game.

The problem can be modeled using dynamic programming. Let \(dp[i]\) be a boolean which is true if the current player can force a win when there are \(i\) candies remaining, and false otherwise. The recurrence for \(dp[i]\) is given by:

[ dp[i] = \bigvee_{j=1}^{K} \big( (i-j \ge 0) \wedge \lnot dp[i-j] \big) ]

Determine whether Alice can guarantee a win under optimal play.

inputFormat

The input is given via standard input (stdin). The first line contains an integer T representing the number of test cases. Each of the following T lines contains two integers: N and K, representing the total number of candies and the maximum number of candies that can be taken in one move, respectively.

For example:

5
10 3
5 4
7 2
1000 1
1 1

outputFormat

For each test case, output a single line via standard output (stdout) with either "Alice" or "Bob". Output "Alice" if she can force a win when both players play optimally, and "Bob" otherwise.

## sample
1
10 3
Alice

</p>