Count Turns

Time limit: 0.1s Memory limit: 256MB Input: Output:

Alice and Bob are playing the following game: There are NN stones in a pile, and a positive integer KK. They take turns with Alice going first. In one turn, the player can take at least one and at most KK stones from the pile. The game ends when there are no more stones left.

Task

Alice wins, if the total number of turns until this point is divisible by KK, Bob wins otherwise. Given NN and KK, determine who has a winning strategy.

Input data

The first line of the input file contains a single integer TT, the number of test cases. TT test cases follow. Each test case consists of a line containing integers NN, KK, the number of stones in the pile and the maximum number of stones that can be taken in one turn, respectively.

Output data

The output file must contain TT lines corresponding to the test cases, each consisting of the string Alice, if Alice has a winning strategy, or Bob otherwise.

Constraints and clarifications

  • 1T1001 \leq T \leq 100;
  • 1KN1091 \leq K \leq N \leq 10^9;
  • Let N\sum N be the sum of the NN-s over the test cases.
  • N109\sum N \le 10^9
# Score Constraints
1 0 Examples
2 15 N100\sum N \le 100
3 25 N103\sum N \le 10^3
4 40 N109\sum N \le 10^9
5 20 No additional restrictions

Example 1

stdin

3
3 2
4 3
47 7

stdout

Alice
Bob
Bob

Explanation

In the first example Alice can take two stones, forcing Bob to take the last one. The total number of turns is two, which is divisible by K=2K=2, so Alice wins.

In the second example Bob can always force the game to end in two turns, winning the game.

Log in or sign up to be able to send submissions!