ANDI AND BOB
Practice
5 (1 votes)
Algorithms
Open
Approved
Medium
Problem
33% Success 700 Attempts 30 Points 4s Time Limit 256MB Memory 1024 KB Max Code

Andi and Bob were two great friends. The tales of their friendship were famous all over the Hackland. Andi liked watching Takeshi's Castle while Bob loved Beyblade. One fine evening, the timings of their favourite shows clashed and the problem was that they had a single TV. They forgot the friendship and started fighting for the TV remote. Andi's mom was watching all this from a corner of the room and, being a wise lady, she challenged both of them to play a game and the winner of the game gets a chance to enjoy his favourite show.

Here goes the game. She gave them both a GAMING ARRAY !! and listed all the subarrays of the GAMING ARRAY. Andi started the game and both the players played turn by turn. In his turn Andi can remove any subarray from the list which has the sum of all its elements even while Bob can do the same in his turn for any subarray with odd sum. The player who is not able to make a move loses. Help Andi's mom in determining the winner of the evening.

NOTE: Huge data set use scanf/printf instead of cin/cout.

INPUT :
The first line of the input contains a single integer T = the number of test cases. The first line of every test case contains an integer N = the number of elements in the GAMING ARRAY. The next line contains N space separated integers, the elements of the array.

OUTPUT:
The name of the winner ANDI or BOB.

CONSTRAINTS :
0 < T < 10
0 < N < 5 * 10^6
1 <= GAMING ARRAY[i] <= 10^6

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
No similar problems found