Jenga Game

3.2

28 votes
Easy-Medium
Problem

Douglas and Charles are bored of playing the traditional Jenga game. So, they decided on modifying the game to make it more interesting.

There are N piles of Jenga with Ai Jenga pieces in the ith pile. Piles are numbered from 1 to N. Douglas and Charles play alternatively starting from Douglas. In a turn, a player chooses a pile of Jenga i with atleast i Jenga pieces in it, and removes exactly i pieces from it. The game ends when further move is not possible i.e. when there is no such pile. Formally, a player can select a pile i only if it has i pieces left in it and will remove exactly i pieces from it.

The player who plays last wins the game. Assuming both Douglas and Charles play optimally, who will win the game?

Input

The first line consists of the number of test cases T( 1<=T<=100 ). Each test case consists of two lines.

First line in each test case denotes N( 1<=N<=1000 ) - the number of Jenga piles. The second line contains N space separated integers, specifying number of Jenga pieces in piles numbered 1,2,...,N. There will atleast 1 and atmost 109 Jenga pieces in each pile.

Output

Output T lines, one per test case. For each case, output "Douglas"(without quotes) if Douglas wins the game, and "Charles"(without quotes) if Charles wins the game.

Author: Karan Thakkar

Tester : Aayush Kapadia and Jinesh Shah

Sample Input
2
1
1
2
1 1
Sample Output
Douglas
Douglas
Time Limit: 1
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?