Card Cutting
Time limit1sMemory limit128 MB
Read each game line of card values up to '*', count odd values for Cheryl and even values for Tania, and print the winner or Draw.
- Level
Easy2 of 10
- Topics
- Implementation, String, Brute force
- Solved
- No attempts yet
Problem
Cheryl and Tania often play a simple card cutting game. They first remove all the picture cards (Jack, Queen, King), then take turns cutting the pack. Every time a card turns up, Cheryl scores a point if its value is odd, and Tania scores a point if its value is even. When they get fed up, they add up their points.
Input
The input contains data for several games. Each game is given on a single line as a list of card values separated by single spaces. A represents an Ace and counts as . The highest card value is . The last token on each line is a *, which marks the end of that game and must not be processed as a card.
The input is terminated by a line containing just a #; that line must not be processed.
Output
For each game, print a single line with the name of the winner, Cheryl or Tania. If both girls score the same number of points, print Draw instead.
Hint
In the first game Cheryl scores points for A, 3, A, 3, A and 5, while Tania scores points for 2, 8 and 10.
In the second game Cheryl scores points for 9, 3, 3 and 7, and Tania also scores points for 2, 4, 6 and 8, so the game is a draw.