-->
当前位置:首页 > 题库

PROGRAMMING:Overspeed detection

Luz5年前 (2021-05-10)题库434
On the highway, there is a device that can detect the speed of the vehicle. Its principle is to detect the time of passing the distance within a fixed distance, calculate the driving speed and detect whether it is speeding.
If the speed exceeds the speed limit, a red light will be displayed; otherwise, a green light will be displayed. Now you have a chance to simulate the device and give the maximum speed allowed. Judge whether red light or green light is displayed.
###Input format:
The first line contains two integers, $$n \ \ K $$, $$n $$indicates that there are $$n $$vehicles passing by during this period of time, $$k $$indicates the maximum speed allowed
Next, $$n $$lines, two integers per line, $$m \ \ S $, denote the distance traveled and the time traveled.
$$tips$$ : $$ 1<= n <= 10 $$ , $$40<=k<=80$$,
$$1<=m<=100$$ , $$1<=s<=10$$
###Output format:
Output a total of $$n $$lines
Output "red" or "green" for each line
###Input example:
Here is a set of inputs. For example:
```in
1 40
100 3
```
###Output example:
The corresponding output is given here. For example:
```out
GREEN
```







answer:If there is no answer, please comment