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.
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 enemy camps.
For each N, print "Bane" if Bane wins, else print "Joker". (Quotes for clarity)
1 <= T <= 3333
3 <= N <= 3333
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.
Case two: Joker wins by opening the 3rd cell i.e. configuration (--o--).
Could We have some more test cases and output?
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 ?