C. Baburao’s Game

0

0 votes
Problem

                                :- tera toh game bajana padega (Baburao)

BabuRao and Raju are sitting in the chaul with a sequence of integers Herapheri . They decided to play a  game on this sequence. They take alternating turns. The sequence is strictly increasing. Each player must do the operation allowed to them.Baburao plays first.In Baburao's turn he has to choose two consecutive elements of Herapheri. Once he does so, he has to erase the larger of these two elements.In Raju's turn also begins with him choosing two consecutive elements of Herapheri. However, Raju always erases the smaller of those two elements.The game terminates when only one element of Herapheri remains. Its value (rokda) is the result of the game. Baburao’s objective is to maximize (rokda), while Raju’s objective is to minimize (rokda).Determine the winner and return the value of (rokda).The player whose objective is met wins the game.

Input

There are T test cases  (1 <= T <= 100)

The first line of each test case contains one integer n (2  ≤ n ≤ 104) — the number of integers in Herapheri.

The second line contains n distinct integers a1 ,a2 ,… ,an (1 ≤ ai ≤ 106) — the integers in Herapheri.

Output

For each test case output a String specifying the winner (Baburao / Raju) and a integer ,the value of rokda.

Output is case sensitive.

 

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

Baburao will try to maximize the result so he will choose (2,4) and remove 4, then Raju will choose

(8,11) and remove 8 , then Baburao chooses (2,11) and remove 11 and size of array is 1 and value left is 2, so Raju’s objective is achieved , Raju wins.

Editor Image

?