[Solution] Hackerman CodeChef Solution | Solution CodeChef
Problem
Hackerman wants to know who is the better player between Bob and Alice with the help of a game.
The game proceeds as follows:
- First, Alice throws a die and gets the number
- Then, Bob throws a die and gets the number
- Alice wins the game if the sum on the dice is a prime number; and Bob wins otherwise.
Given and , determine who wins the game.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- The first and only line of each test case contains two space-separated integers and .
Output Format
For each test case, output on a new line the winner of the game: Alice
or Bob
.
Each letter of the output may be printed in either uppercase or lowercase, i.e, Alice
, ALICE
, AlIce
and aLIcE
will all be considered equivalent.
Explanation:
Test case : and . Their sum is which is a prime number, so Alice wins.
Test case : and . Their sum is which is a prime number, so Alice wins.
Test case : and . Their sum is which is not a prime number, so Bob wins.
No comments:
Post a Comment