This page is still under construction.

Parts of this page are still being built. What you see may change.

Golden Ratio Test

Time limit1sMemory limit256 MB

Summary
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, φ\varphi, whose value is

φ=1+52=1.61803399…\varphi = \frac{1 + \sqrt{5}}{2} = 1.61803399\ldots

You are given two real numbers aa and bb. Decide whether aa divided by bb equals the golden ratio or comes close enough to it. The allowed error is ±1%\pm 1\%, so the pair counts as golden when it satisfies the following inequality.

∣ab−φ∣≤φ100\left|\frac{a}{b} - \varphi\right| \le \frac{\varphi}{100}

The division follows the order given in the input. The value of bb divided by aa is not used in the decision.

Input

The first line contains the number of data sets TT. (1≤T≤3001 \le T \le 300)

Each of the next TT lines contains two real numbers aa and bb separated by one space. A number may or may not have a decimal point. The bounds are 0.000001≤a≤10000000.000001 \le a \le 1000000 and 0.000001≤b≤10000000.000001 \le b \le 1000000, 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.

Examples3

  1. Example 1

    Input
    3
    1.61803399 1
    1.699 1.0
    1 1
    
    Expected output
    golden
    not
    not
    
  2. Example 2

    Input
    4
    8 5
    13 8
    21 13
    34 21
    
    Expected output
    not
    golden
    golden
    golden
    
  3. Example 3

    Input
    2
    1 1.61803399
    1.61803399 1
    
    Expected output
    not
    golden