Desik And Chef
All submissions for this problem are available.
2 players "Desik" and "Chef" play a game on an array of size N+1, where the first index of the array is 0 and the last index is N. And all the indices from "1" to "N" of the array have numbers assigned to it.
In one operation you can do the following move:-
- First Line specifies an integer T, the number of test cases.
- Each test case consists of an integer N denoting the number of array elements.
- N lines follow denoting the array elements.
- For every test case print "Desik" or "Chef" whoever wins the game without quotes in a new line.
- 1 ≤ T ≤ 10 ^ 2
- 1 ≤ N ≤ 10 ^ 4
- 0 ≤ Array elements ≤ 10 ^ 9
Input: 3 1 2 1 1 2 1 2 Output: Chef Desik Desik
Case 1: Initial Array:- 2
In the first move Desik can only subtract 1 number from the 1st Index.
In the Second Move Chef subtracts 1 number from the 1st Index.
Now every array number is 0. So As Chef Moved last he is the winner.
Case 3: Initial Array:- 1 2
Desik subtracts 1 from the 1st Index and adds it to the 0th index as there is no odd element before 1st index.
Now whatever move Chef does Desik can win the game.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions