Coin Game
Practice
3.8 (53 votes)
Ad Hoc
Easy
Implementation
Problem
81% Success 16800 Attempts 20 Points 1s Time Limit 512MB Memory 1024 KB Max Code

Charlie and Alan have challenged each other to a game of logic with coins.

The game consists of N piles of coins with each pile consisting of \(A_{i}\) coins. The game progresses as follows: in each turn a player selects any of the piles with even number of coins and removes exactly the half the coins out of that pile. The game ends when a player can't make a move. The last move is a winning move.

Charlie makes the first move. Assuming both players play optimally, predict who wins the game.

Input

The first line consists of the number of test cases T (\(1<=T<=100\)).

Each test case consists of two lines.

The first line in each test case contains the single integer N (\(1\leq N \leq 1000\)) — the number of piles of coins.

The second line contains N space separated integers \(A_i\) (\(1 \leq A_i \leq 10^9\)), specifying number of coins in piles.

Output

Output T lines.

For each case, output "Charlie" (without quotes) if Charlie wins the game, and "Alan"(without quotes) if Alan wins the game.

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
Points:20
58 votes
Tags:
ArraysEasyMath
Points:20
23 votes
Tags:
Basic ProgrammingString
Points:20
19 votes
Tags:
ApprovedBasic ProgrammingEasyMathOpen