Golden Ratio Test
Time limit1sMemory limit256 MB
Given T pairs of numbers, print golden for each pair whose ratio a/b is within 1 percent of the golden ratio.
- Level
Easy1 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
Nature has several special irrational numbers. One of them is the golden ratio, written with the Greek letter phi, , whose value is
You are given two real numbers and . Decide whether divided by equals the golden ratio or comes close enough to it. The allowed error is , so the pair counts as golden when it satisfies the following inequality.
The division follows the order given in the input. The value of divided by is not used in the decision.
Input
The first line contains the number of data sets . ()
Each of the next lines contains two real numbers and separated by one space. A number may or may not have a decimal point. The bounds are and , and no number has more than 10 digits after the decimal point.
Output
Print one line for each data set. Print golden when the inequality above holds, and not when it does not.