#K45527. Gear Color Determination
Gear Color Determination
Gear Color Determination
You are given a grid of gears identified by their coordinates. The color of a gear at coordinate \((i,j)\) is determined by the following rules:
- If both \(i\) and \(j\) are even or both are odd (i.e., \(i \equiv j \pmod{2}\)), the gear is Red.
- If one coordinate is even and the other is odd, the gear is Blue.
Your task is to determine the color of each gear based on its coordinates.
Input and Output Format:
The program reads from standard input and writes to standard output.
inputFormat
The first line contains a single integer \(n\), the number of coordinates.
Each of the following \(n\) lines contains two space-separated integers \(i\) and \(j\) representing the coordinates of a gear.
It is guaranteed that all input values are valid integers.
outputFormat
Output \(n\) lines, each containing the string Red
or Blue
corresponding to the color of the gear at the given coordinate.
3
2 3
4 4
1 2
Blue
Red
Blue
</p>