#P8344. 「Wdoi-6」走在夜晚的莲台野
「Wdoi-6」走在夜晚的莲台野
Background
In the Scientific Century, science is thriving and information technology is highly developed. But at the same time, imagination has died out. Things that cannot be explained are erased as “errors”, and mysteries that cannot be explained are denied.
Usami Renko (Renko) and Maribel Hearn (Merry) founded a club—the Hifuu Club. As members of the Hifuu Club, they search for the boundary of fantasy, and in a world that is gradually being forgotten, they pursue what is truly beautiful.
Their first activity is to explore a breach in the barrier of Rendaino.
Problem Description
Brief Statement
There are golden planks, silver planks, and an empty container that can hold planks. Each time you put one golden plank into the container, after that, all silver planks currently in the container will be discarded (you must ensure that before putting in the golden plank, the container still has room for at least one more plank). Ask whether there exists a way such that all planks have been put into the container at least once.
Original Statement
At the entrance of Rendaino, Renko and Merry want to cross the boundary between reality and illusion and enter Gensokyo. However, crossing the boundary has certain requirements.
Specifically, beside the boundary there are several long planks: of them are golden planks, and of them are silver planks. Using her ability to see the boundary, Merry found a container that can hold planks, and learned the rules through her subconscious:
- If they put in a golden plank (you must ensure that before putting in the golden plank, the container still has room for at least one more plank), then all silver planks in the container will be discarded.
- In the end, all planks must have been put into the container, and only then will the gate of the boundary open, i.e., they can enter Gensokyo.
It is now 2:27:41 a.m. Only if they finish this task before 2:30 a.m. can they enter Gensokyo. Renko and Merry now hand this problem to you, hoping you can give an answer as soon as possible: is there a plan that allows them to enter Gensokyo?
Since Renko and Merry worry that you might fool them in the middle of the night, they will ask you a total of times.
Input Format
- The first line contains a positive integer , representing the number of test cases.
- Starting from the second line, the next lines each contain three positive integers , with meanings as described in the statement.
Output Format
For each query, output one line with the answer. If there exists a plan, output Renko; otherwise, output Merry.
3
2 6 4
5 8 2
10 10 22
Renko
Merry
Renko
10
221 44724 313
157 60759 464
181 145867 893
182 59650 418
384 168626 631
702 650463 194
617 376055 918
261 215764 955
502 744180 440
9 1626 168
Renko
Merry
Renko
Renko
Renko
Merry
Merry
Merry
Merry
Renko
Hint
Sample Explanation
Sample #1
- For the first query, one feasible plan is:
- First put in three silver planks.
- Then put in one golden plank.
- Then put in two silver planks.
- Then put in one golden plank.
- Then put in one silver plank.
- This way, every plank has been put into the container at least once, so Renko and Merry can enter Gensokyo. Therefore output
Renko. - For the second query, clearly there is no plan.
- For the third query, you can first put in ten golden planks, then put in ten silver planks.
Sample #2
This sample set satisfies the requirements of .
Constraints
This problem uses bundled testdata.
$$\def\arraystretch{1.5} \begin{array}{|c|c|c|c|c|c|c|}\hline \textbf{Subtask} & \textbf{\textsf{分值}} & \bm{T\le } & \bm{x\le} & \bm{y\le} & \bm{z\le} & \textbf{Subtask \textsf{依赖}}\cr\hline 1 & 20 & 1 & 10 & 10 & 10 &-\cr\hline 2 & 30 & 10 & 10^3 & 10^6 & 10^3 &1\cr\hline 3 & 20 & 100 & 10^6 & 10^9 & 10^6 &2\cr\hline 4 & 30 & 1000 & 10^9 & 5 \times10^{17} & 10^9 &3\cr\hline \end{array}$$For of the data, it is guaranteed that , , 。
Translated by ChatGPT 5
