As all people know ICPC can be very dull sometimes for people other than contestants. Jodu, Modu, and Kodu visit the contest area and watch area. They are having fun. But after some time they became bored because contestants take so much time solving exceptionally hard problems. So they come up and started playing a game.
The game goes as follows,
Jodu and Modu will play against each other.
There will be an empty list with max capacity .
There will be rounds.
In each round:
Jodu guesses a number
Modu guesses a number
if is smaller than :
is added to Modu's score.
Jodu will have to add the last element of the list to his score if it is smaller than .
After adding an element it must be removed.
Jodu will have to do this until the list is empty or he cannot add any more.
If the list is not full, then is added to the last of the list.
else:
is added to Jodu's score.
Modu will have to add the last element of the list to his score if it is smaller than .
After adding an element it must be removed.
Jodu will have to do this until the list is empty or he cannot add any more.
If the list is not full, then is added to the last of the list.
Then the round ends.
The one having the more score will be in the lead.
Kodu have to track who is in the lead.
They have been playing for a long time. Keeping track manually Kodu got bored and started making mistakes.
Kodu has asked you to write him a program that will keep track of each round’s leading player, given and of each round.
The first line will be an integer indicating the number of test cases. Every test case starts with Two integers and denoting the number of rounds they are playing and the maximum capacity. The following lines will contain two integers and separated by spaces.
For every test case, first print a line in the format “Case X:” where is the number of test cases starting from . Next, You have to output lines. In the next n lines, you have to print the round’s leading player name “Jodu“, “Modu“ or “Draw“, if both players’ scores are same.
Input | Output |
---|---|
1 4 3 2 3 3 2 4 6 2 5 | Case 1: Jodu Draw Modu Draw |
Initially, After 1st round, After 2nd round, After 3rd round, After 4th round, |
Input | Output |
---|---|
1 4 3 1000 2000 2048 1024 48 2928 1 100000 | Case 1: Jodu Jodu Modu Modu |