当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3086:Need for Speed

题目描述
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.

To simplify this problem, we just assume that only one police car ran after Jiaoshou. And Bugatti Veyron’s speed is vx. The police car’s speed is vy. v is a function of first degree or a constant, as the form of a*m+b. In this form, m means the minute that the car has run.
Now Jiaoshou is S meters ahead. Jiaoshou like to know if he could escape from the chase. He want you to write a program to solve this problem.
输入解释
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.
输出解释
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.”

输入样例
2
100
0 10
0 20
1000
0 1
0 0
输出样例
Oh,God!Jiaoshou will be catched after 10.000 minutes.
Good driver,Jiaoshou!
来自杭电HDUOJ的附加信息
Author Water Problem SecKill Expert
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3086

最后修改于 2020-10-25T22:59:53+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)