#P16298. [蓝桥杯 2026 省 Python C 组] 解题速度对决
[蓝桥杯 2026 省 Python C 组] 解题速度对决
Problem Description
Under the incandescent lights in the computer lab, the sound of typing rises and falls.
Xiaolan and Xiaohong agree to have a duel on problem-solving speed. There are a total of problems in the contest. They start at the same time, and whoever finishes all problems first wins.
Although the problems are the same, their solving rhythms are very different:
- Xiaolan: Solving each problem always takes minutes. But he has a special habit: after finishing the -th problem, he needs to rest for minutes to calm down before starting the next problem.
- Xiaohong: Solving each problem always takes minutes. Similarly, after finishing the -th problem, she needs to rest for minutes.
You are the judge of this duel. Given the total number of problems and the time parameters of both players, please determine the final winner.
If Xiaolan wins, output BLUE. If Xiaohong wins, output RED. If they finish at the same time, it is a draw; output DRAW.
Input Format
The first line contains an integer , indicating that there are groups of testdata.
The next lines each contain five integers , with meanings as described above.
Output Format
For each group of testdata, output one line with the result:
- If Xiaolan finishes first, output
BLUE. - If Xiaohong finishes first, output
RED. - If they finish at the same time, output
DRAW.
3
3 5 2 4 3
3 5 2 4 2
3 5 2 4 4
DRAW
RED
BLUE
Hint
Constraints
For of the test cases, , .
For all test cases, , .
Translated by ChatGPT 5