Submit | All submissions | Best solutions | Back to list |
CHAOS_CC - Chaos In Arkham |
Mayhem has struck Arkham Asylum!
Both Bane and Joker are running free in Arkham and rescuing other prisoners. The prison of Arkham consists of N cells in a row. To decide who is superior, they play the following game: Both take turns alternately, and in each turn a player can open any one cell of the prison. They define a block of 3 consecutive open prison cells as a "crime hole". The first one to create a "crime hole" wins and is declared as the Ultimate Villain of Gotham. Joker plays first.
As we know Bruce Wayne always keeps track of his enemies. In this situation he needs a program to decide who will emerge as the Ultimate Villain if both play optimally.
Input
First line of input contains number of Test Cases T, followed by T lines. On each line you are given a single integer N, depicting the number of prison cells.
Output
For each N, print "Bane" if Bane wins, else print "Joker". (Quotes for clarity)
Constraints
1 <= T <= 3333
3 <= N <= 3333
Example
Input: 3 3 5 6 Output: Joker Joker Bane
Explanation
Let us denote the open cells by 'o' and closed cells by '-'.
Case one: Initially all cells are closed(---), if Joker opens first cell configuration is (o--). Bane can either open second cell leading to configuration (oo-) or third cell (o-o). In both cases Joker wins on his next turn.
Case two: Joker wins by opening the 3rd cell first i.e. configuration (--o--).
Added by: | smit hinsu |
Date: | 2013-02-18 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | CodeCraft 13 , Author : Nikhil Goyal |
hide comments
2022-07-07 20:41:52 Simes
Caution: test data contain a case where n=2. Last edit: 2022-07-07 21:00:20 |
|
2013-03-31 18:50:11 RADHS
Could We have some more test cases and output? |
|
2013-02-20 08:46:51 Pradep Kumar
There is no crime hole in o-o or oo- examples given in the Explanation as crime holes are of size 3. How does the Joker win in these cases ? |