407541: GYM102823 J Stone Game

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Stone Gametime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Alice and Bob are always playing game! The game today is about taking out stone from the stone piles in turn.

There are $$$n$$$ piles of stones, and the $$$i$$$-th pile contains $$$A[i]$$$ stones.

As the number of stones in each pile differs from its neighbor's, they determine to take out exactly one stone from one of them in one turn without breaking that property. Alice goes first.

The player who cannot take stone will lose the game.

Now you have to determine the winner given $$$n$$$ numbers representing the piles, if they both play optimally.

You should notice that even a pile of 0 stone is still regarded as a pile!

Input

The first line of input file contains an integer $$$T$$$ ($$$1\le T\le 100$$$), describing the number of test cases.

Then there are $$$2 \times T$$$ lines, with every two lines representing a test case.

The first line of each test case contains only one integer $$$n$$$ ($$$1\le n\le 10^5$$$) as described above.

The second line of that contains exactly $$$n$$$ numbers, representing the number of stone(s) in a pile in order. All these numbers are ranging in $$$[0,10^9]$$$.

It is guaranteed that the sum of $$$n$$$ in all cases does not exceed $$$10^6$$$.

Output

You should output exactly $$$T$$$ lines.

For each test case, print Case $$$d$$$: ($$$d$$$ represents the order of the test case) first, then print the name of winner, Alice or Bob.

ExampleInput
2
2
1 3
3
1 3 1
Output
Case 1: Alice
Case 2: Bob
Note

Sample 1:

There is a possible stone-taking sequence: $$$(1,3)\rightarrow(1,2)\rightarrow(0,2)\rightarrow(0,1)$$$

Here is an invalid sequence: $$$(1,3)\rightarrow(1,2)\rightarrow(1,1)\rightarrow(0,1)$$$. Though it has the same result as the first sequence, it breaks that property "the number of stones in each pile differs from its neighbor's".

加入题单

上一题 下一题 算法标签: