DCEPC14C - The Long Pile Game

no tags 

Alice and Bob are playing the following game.

They choose two different positive integers K and L, and start the game with a tower of N coins. Alice always plays first, Bob – second, after that – Alice again, then Bob, and so on. They in turn can take 1, K or L coins from the tower.

The winner is who takes the last coin (or coins).

After a long, long playing, Alice realizes that there are cases in which she could win, no matter how Bob plays. And in all other cases Bob being careful can win, no matter how Alice plays.

Given N, K, L predict if Alice can win if both play optimally.

Constraints

1 ≤ K ≤ 20

1 ≤ L ≤ 20

1 ≤ N ≤ 1000000000

T ≤ 100000

Input

First line contains T - number of cases,

Next T lines each contain 3 integer K, L, N.

Output

For each case print “Alice” (without quotes) if Alice can win, otherwise print “Bob” (without quotes).

Example

Input:
5
5 4 8
1 3 9
4 3 10
1 1 5
1 5 6

Output:
Bob
Alice
Alice
Alice
Bob

hide comments
mahilewets: 2017-09-07 21:07:34

Hm, but if K is big, and L is small...

mahilewets: 2017-09-07 21:06:33

Currently I can only think about algorithms

Which run faster with big N and K...

Last edit: 2017-09-07 21:06:52
(Tjandra Satria Gunawan)(曾毅昆): 2015-07-17 01:57:37

K and L <=20, easy constraints ;-)


Added by:dce coders
Date:2015-04-26
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:C CSHARP C++ 4.3.2 CPP CPP14 C99 GOSU JAVA PAS-GPC PAS-FPC PYTHON PYPY PYTHON3 PY_NBC