#GL0000094. Hàng rào vô tận (Infinite Fence)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Hàng rào vô tận (Infinite Fence)
Infinite Fence
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
A fence consists of planks indexed from . A plank whose index is divisible by must be painted red, and one divisible by must be painted blue. If an index is divisible by both, either color may be chosen. All other planks must remain unpainted. Consider only painted planks in increasing index order, skipping unpainted planks. Determine whether it is possible to avoid having consecutive painted planks of the same color. Print OBEY if possible and REBEL otherwise.
Input
One line containing three integers .
Output
Print exactly OBEY or REBEL.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
2 10 4
Output
REBEL
Explanation
Indices must be red. They form four consecutive painted planks before index , where either color is allowed. Since , a forbidden run is unavoidable and the output is REBEL.