Number Line Battle
Time: 1 s
Memory: 250 MB
Memory: 250 MB
Maruf and Redoy are playing a game with a number line containing integers from 1 to 𝑛
Maruf moves first and can remove only odd numbers on his turn, Redoy can remove only
even numbers on his turn, each player removes exactly one number per turn, the game
ends when no valid moves are left, and the player who makes the last move wins;
determine who will win if both play optimally.
Maruf moves first and can remove only odd numbers on his turn, Redoy can remove only
even numbers on his turn, each player removes exactly one number per turn, the game
ends when no valid moves are left, and the player who makes the last move wins;
determine who will win if both play optimally.
Input
A sigle integer n - the maximum number on the number line
Constraint
1 <= n <= 10^17
Output
If Maruf win then print "MARUF" otherwise print "REDOY"
Examples
| Input | Output |
|---|---|
|
7
|
MARUF
|
Problem Info
| Problem ID | 938 |
| Time Limit | 1000 ms |
| Memory Limit | 256000 KB |
| Moderators | M_41_M |
Statistics
Submit
You need to Login or Registration for submit your solution