Alice and Bob are playing a game. They have 3 bags, each consisting a certain number of balls. Alice starts the game by picking a ball from any one of the bag.Then Bob picks a ball from one of the other 2 bags. That is, in their turn they have to pick a ball from any of the bags, except the bag from which the other player picked up in their last turn. The player who cannot make a move loses. Given that both Alice and Bob play optimally, you are supposed to tell who is going to win.
The first line contains a number T, the number of testcases. Next T lines contain 3 space separated integers A,B,C each of which depicts the number of balls in the three bags.
For each test case output a single line with the winner, "Alice" or "Bob" without the quotes.
- 1 ≤ T ≤ 1000
- 1 ≤ A,B,C ≤ 1000
Input: 3 1 1 1 1 1 2 2 2 2 Output: Alice Bob Bob
1. Alice picks up a ball from bag 1
2. Bob picks up a ball from bag 2
3. Alice picks up a ball from bag 3
Now Bob cannot make a move since there are no more balls left, hence Bob loses and Alice wins.
1. Alice picks from bag 1
2. Bob picks from bag 2
3. Alice picks from bag 1
4. Bob picks from bag 3
5. Alice picks from bag 2
6. Bob picks from bag 3
|Time Limit:||0.144848 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, GO|
Fetching successful submissions