Character game
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Time Limit: 1.0 s
Memory Limit: 256.0 MB
Description
Mahfuj and Roy is going to play a game which is called character game. Mahfuj loves character 'q' where Roy loves character 'p'. In this game, you are given a string S which contains only character 'p' and 'q'. You need to find out, if the number of occurance 'p' is greater than 'q' then Roy win or the number of occurance 'q' is greater than 'p' then Mahfuj win or both character has equal occurance then Draw.
Input
First line of input takes an integer \(T\) : number of testcases
Each of the next \(T\) testcase takes a string \(S\) : describing the game
1 <= \(T\) <= 10
1 <= \(|S|\) <= 100
Output
Print \(T\) lines : each line should print the winner of the game or "Draw" if there is no winner
Sample
Input | Output |
---|---|
|
|
1st test case, string S = "pqp", occurance of p=2 and q=1. p is greater than q, so Roy wins.
2nd test case , string S = "qqqp", occurance of p=1 and q=3. q is greater than p, so Mahfuj wins.
3rd test case , string S = "pppqqq", occurance of p=3 and q=3. they are equal, so print Draw.
TLE_Headquarters - round #1
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 9
- Start at
- 2024-03-27 16:00
- End at
- 2024-03-27 18:30
- Duration
- 2.5 hour(s)
- Host
- Partic.
- 62