Painted Numbers
Time limit1sMemory limit128 MB
Decide the red or blue color of each positive rational when adding 1 flips the color, reciprocals share it, and 1 is red.
- Level
Medium7 of 10
- Topics
- Number theory, Math
- Solved
- No attempts yet
Problem
Every positive rational number has been painted with one of two colors, red or blue, so that:
- two numbers that differ by exactly are painted different colors,
- two numbers that are reciprocals of each other are painted the same color,
- the number is painted red.
Determine the color of a given number.
Input
The first line contains a natural number (), the number of test cases.
Each of the next lines contains one positive rational number in the form a / b, where and are positive integers ().
Output
For each test case, print the color of the given number on its own line: czerwony for red, or niebieski for blue.
Hint
, so its color must be the opposite of the color of .
is the reciprocal of , so they share a color, and , so that color must be the opposite of the color of .