Limits 2s, 1.0 GB

Our hero ‘Shrawan’ is in love with a beautiful girl named ‘Barsha’. On the upcoming Valentine Day, he has a plan to propose her with a nice ‘Diamond Ring’. As Barsha is very choosy in selecting things, she won’t say ‘Yes’ until she gets the right Diamond Ring. So, Shrawan is in trouble to find the right one for her. Would you help Shrawan to get his love?

Shrawan knows the perimeter (p) of the ring finger of Barsha. Now he goes to a shop and sees some Rings. Each Diamond Ring made of a regular ring with a Diamond on top (see the figure above). A regular ring is circular in shape where d is the difference between the radiuses of the two (inner and outer) circles. The Diamond is square in shape with sides a. You can safely assume that the ring will fit perfectly to Barsha’s finger (p = perimeter of the inner circle).

Considering the given 2D shape, a right Diamond Ring will be the one in which the area of the Diamond is at least 10% of the total area. With the necessary information, your task is just to check the Diamond Ring if it’s the right one or not.

Input

Input starts with an integer T (≤ 100), denoting the number of test cases.
Each case contains three integer numbers p (0 < p ≤ 100) denoting the perimeter of the finger, d (0 < d ≤ 100) denoting the difference between the radiuses of the two circles and a (0 < a ≤ 100) denoting the sides of the square.

Output

For each case, print a message “Congratulations!” (without quote) if the given Diamond Ring is right for Barsha or print “Bring a better ring!” (without quote) if it’s not.

Sample

InputOutput
2
10 2 1
10 1 2
Bring a better ring!
Congratulations!

Submit

Login to submit.

Statistics

83% Solution Ratio
prodip_bsmrstuEarliest, Oct '19
prodip_bsmrstuFastest, 0.0s
prodip_bsmrstuLightest, 131 kB
mdvirusShortest, 336B
Toph uses cookies. By continuing you agree to our Cookie Policy.