#K59302. Traffic Light Simulator
Traffic Light Simulator
Traffic Light Simulator
This problem simulates the state transitions of traffic lights at a four-way intersection over a given number of timesteps. The traffic lights follow a cyclic pattern with a period of \(20\) timesteps. The states for each direction (North, East, South, West) are determined based on the value of \(t \mod 20\):
- For \(0 \leq t\%20 < 5\): North and South are Green, East and West are Red.
- For \(5 \leq t\%20 < 10\): North and South are Yellow, East and West are Red.
- For \(10 \leq t\%20 < 15\): North and South are Red, East and West are Green.
- For \(15 \leq t\%20 < 20\): North and South are Red, East and West are Yellow.
Your task is to write a program that reads the number of timesteps from standard input and then prints the current state of the traffic lights for each direction in the order North, East, South, and West on separate lines.
inputFormat
The input consists of a single integer \(t\) (\(0 \leq t \leq 10^9\)) representing the number of timesteps. It is read from stdin.
outputFormat
Output four lines to stdout. Each line should contain the traffic light state (one of Green, Yellow, or Red) for the directions North, East, South, and West respectively.
## sample0
Green
Red
Green
Red
</p>