May The Force Be With You!
All submissions for this problem are available.
Chewbacca needs a droid to accompany him to Tatooine.
C3PO feels that he would be a better choice(being well versed in over 5 million languages) but R2D2 is adamant that he will accompany Chewbacca to save Han Solo
from the evil crime lord Jabba the Hutt.
To decide who will go, they agree on playing Roll the Dice game 'n' times.
In a turn, both of them roll a dice and score a positive number between 1 and 6.
The total score of a droid is defined as the sum of numbers scored by the droid in all the turns. The one with a higher total score is the winner.
Since C3PO is just an interpreter and R2D2 has an outdated processor both of them are too weak in maths, they asked you to help!
The first line of the input contains an integer T, the number of test cases.
The first line of each case will have an integer N, the number of times R2D2 and C3PO plays the game.
The following N lines contain two integers, the number scored by C3PO and R2D2 in each turn.
You have to determine which one of the two is the Winner of "Roll The Dice" game.
Print "C3PO"(without double quotes) if he is the Winner.
Otherwise print "R2D2" (without double quotes).
If both of them have equal points, print "Draw" (without double quotes).
1 ≤ T ≤ 100
1 ≤ N ≤ 86400
1 ≤ Score in one turn ≤ 6
Input: 3 3 1 4 2 3 6 1 6 1 3 5 2 4 6 3 3 1 4 4 1 5 1 2 2 1 3 3 4 4 5 5 Output: C3PO R2D2 Draw
Test Case 1 : C3PO scored total 9 whereas R2D2 scored 8 points. Hence, C3PO won.
Test Case 2 : C3PO scored 18 and R2D2 scored 19 points. R2D2 scored more points hence, R2D2 won.
Test Case 3 : Both have equal points (15), hence it's a Draw!
|Time Limit:||10 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, 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, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.