1058:Need for Speed

Time/Memory Limit:1000 MS/32768 K
Submitted: 24 Accepted: 11

 Problem Description

Jiaoshou is a fan of “Need for Speed”, a famous game which most people have played. Recently, Jiaoshou had cleared “Need for Speed Undercover”. In this game, Jiaoshou acted as a spy. To prove that he is not a spy, Jiaoshou must do some evil things frequently. So lots of police cars often ran after him. In order to escape from the chase, Jiaoshou need to accelerate his Bugatti Veyron.

 Input

The input contains several tests. The first line of the input is a single integer T (T<1000) which is the number of test cases. Then T test cases follow.
Each test case contains three lines. The first line contains a single real number S (0<S<=10^6) , as the problem has described. The second line contains two real numbers ax, bx, indicating Bugatti Veyron’s speed is ax*m+bx. The last line also contains two real numbers ay, by, indicating the police car’s speed is ay*m+by. All numbers are range from -1000 to 1000, except S.

 Output

If Jiaoshou can escape from the chase, please output “Good driver,Jiaoshou!”. Otherwise, please output the real number M rounded to three digits after the decimal point , in the form of “Oh,God!Jiaoshou will be catched after M minutes.”

 Sample Input

2
100
0 10
0 20
1000
0 1
0 0

 Sample Output

Oh,God!Jiaoshou will be catched after 10.000 minutes.
Good driver,Jiaoshou!

 Author

Water Problem SecKill Expert

 Source

HDU 2nd “Vegetable-Birds Cup” Programming Open Contest

 Recommend

zh