[BOJ 10187] Golden

View as PDF

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

There are many special irrational numbers in nature. One is the “golden ratio” represented by the Greek letter phi, φ, which has a value of</p>

φ = (1 + √5) / 2 = 1.61803399.....

Given 2 real numbers, determine whether their ratio is equal (or close to) the golden ratio. For this program, use ±1% as the tolerance.

입력 형식

The first line will contain the number of data sets. Each data set consists of 2 real numbers (with or without decimals).

출력 형식

Either print out “golden” or “not” for each data set.

예제 입력

3
1.61803399 1
1.699 1.0
1 1

예제 출력

golden
not
not

Comments

There are no comments at the moment.