EOPR - Even Odd Problem
Alice and Bob are playing an interesting game. A basket contains N balls. In each turn one removes some balls (which is less than N and greater than 0) from the basket. If Alice removes an even-number of balls then Bob must remove an odd-number of balls and vice-versa. The winner is who plays the last turn and makes the basket empty. The game is tie when it is impossible to make the basket empty.
Assume both players play optimally. Here optimally means a player plays in a way so that the opponent player does not win.
Note: Alice starts game first.
Input
Input starts with an integer T (≤ 100), denoting the number of test cases.
Each case contains an integer N (1 <= N <= 1000).
Output
For each case, print the case number and “Alice” if Alice wins or “Bob” if Bob wins or “Tie” in case of game is tie.
Example
Input: 2 3 172 Output: Case 1: Bob Case 2: Alice
Problem Setter: Md Abdul Alim, Dept. of Computer Science, Bangladesh University of Business & Technology
Added by: | Alim |
Date: | 2014-06-16 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU |
Resource: | Own Problem |