Sequence Folding#2724

Sequence Folding

1 Sekunde
64 Megabyte
Leicht

Alice and Bob are practicing hard for the new ICPC season. They hold many private contests where only the two of them compete against each other. Their knowledge and skills are so close that many times they tie in both the number of problems solved and the time penalty! To break the tie, Alice and Bob invented a tie-breaker technique called sequence folding. The steps of this technique are as follows:

  1. Generate a random integer N \geq 2.

  2. Generate a sequence of random integers.

  3. If N = 2, go to step 6.

  4. Fold the sequence: add the -th element to the first, the (N-1)-th to the second, and so on; if is odd, the middle element is added to itself. Figure 1 illustrates the process.

  5. Set N = \lceil N/2 \rceil and go to step 3.

  6. When only two numbers remain, if the first is greater than the second, Alice wins; otherwise, Bob wins.

Figure 1.a Before folding

Figure 1.b After one folding step

Figure 1.c After two folding steps, Alice wins!

In this problem, you are given a sequence of integers and are asked to determine the contest winner using the sequence folding tie-breaker technique.

Eingabe

The first line contains (1 \leq T \leq 100), the number of test cases. The first line of each test case contains an integer (2 \leq N \leq 100), the number of elements in the sequence. The next line contains space-separated integers. The sum of any subset of the numbers fits in a -bit signed integer.

Ausgabe

For each test case, print the name of the winner. Follow the output format below.

Beispiele

Beispiel 1

Loading
Loading