Lazy Snakes and Ladders (2)

The author of the previous problem is half a psycho, half a freak. He is well know for his lengthy and weird statements, although a few of his problems are not that hard. Consider for instance the following adaptation of an old problem of the same author.

The rules of Snakes and Ladders (see the board below) are simple:

0.60

0.40

You must simulate several of these games using pseudo-random numbers. In particular, include the <random> library, and declare a global

mt19937 rng;

variable. Every game will be defined by a seed ss. Just do

rng.seed(s);

to reset rng before every game. Afterwards, every time that you need the result dd of the next rolling of the die, use this code:

unsigned int r = rng();
int d = r%6 + 1;

For instance, with the initial seed 42, we get these values for rr: 1608637542, 3421126067, 4083286876, 787846414, … Therefore, the values for dd are 1, 6, 5, 5, … In this game, red goes to 2 (and then to 38), blue goes to 7 (and then to 14), blue moves again (he got a 6) and goes to 19, red goes to 43, …, and eventually blue wins.

Input

Input consists of several games, each one defined by an integer seed ss between 1 and 10910^9.

Output

For each game, print “RED” or “BLUE” depending on the winner.

Problem information

Author: Edgar Gonzàlez

Generation: 2026-01-25T11:26:49.632Z

© Jutge.org, 2006–2026.
https://jutge.org