spoj#DCEPC14C. The Long Pile Game
The Long Pile Game
Alice and Bob 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 he 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 <= 10^5
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 can otherwise print “Bob” without quotes.
Example
Input: 5 5 4 8 1 3 9 4 3 10 1 1 5 1 5 6</p>Output:
Bob Alice Alice Alice Bob