编程介的小学生 2019-08-09 23:45 采纳率: 20.5%
浏览 150

三个状态的判断的计算,算法用C语言的构成

Problem Description
Professor Jonathan is a well-known Canadian physicist and meteorologist. People who know him well call him “Wind Chaser”. It is not only because of his outstanding tornado research which is the most influential in the academic community, but also because of his courageous act in collecting real data of tornados. Actually he has been leading his team chasing tornado by cars equipped with advanced instruments hundreds of times.

In summer, tornado often occurs in the place where Professor Jonathan lives. After several years of research, Wind Chaser found many formation rules and moving patterns of tornados. In the satellite image, a tornado is a circle with radius of several meters to several kilometers. And its center moves between two locations in a straight line, back and forth at a fixed speed. After observing a tornado’s movement, Wind Chaser will pick a highway, which is also a straight line, and chase the tornado along the highway at the maximum speed of his car.

The smallest distance between the Wind Chaser and the center of the tornado during the whole wind chasing process, is called “observation distance”. Observation distance is critical for the research activity. If it is too short, Wind Chaser may get killed; and if it is too far, Wind Chaser can’t observe the tornado well. After many times of risk on lives and upset miss, Wind Chaser turns to you, one of his most brilliant students, for help. The only thing he wants to know is the forthcoming wind chasing will be dangerous, successful or just a miss.

Input
Input contains multiple test cases. Each test case consists of three lines which are in the following format.

xw1 yw1 xw2 yw2 vw
xt1 yt1 xt2 yt2 vt
dl du

In the first line, (xw1, yw1) means the start position of Wind Chaser; (xw2, yw2) is another position in the highway which Wind Chaser will definitely pass through; and vw is the speed of the car. Wind chaser will drive to the end of the world along that infinite long highway.
In the second line, (xt1, yt1) is the start position of tornado; (xt2, yt2) is the turn-around position and vt is the tornado’s speed. In other words, the tornado’s center moves back and forth between (xt1, yt1) and (xt2, yt2) at speed vt .

The third line shows that if the observation distance is smaller than dl , it will be very dangerous; and if the observation distance is larger than du, it will be a miss; otherwise it will lead to a perfect observation.

All numbers in the input are floating numbers.

-2000000000 <= xw1, yw1, xw2, yw2, xt1, yt1, xt2, yt2 <= 2000000000
1 <= vw, vt <= 20000
0 <= dl, du <= 2000000

Note:
1. It’s guaranteed that the observation distance won’t be very close to dl or du during the whole wind chasing process. There will be at least 10-5 of difference.
2. Wind Chaser and the tornado start to move at the same time from their start position.

Output
For each test case output one line contains one word “Dangerous”, “Perfect” or “Miss” which describes the prediction of the observation.

Sample Input
0 0 1 0 2
10 -5 12 7 4
1.3 2.7
0 0 1 0 2
10 -5 12 7 1
0.3 0.4

Sample Output
Dangerous
Perfect

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
    • ¥20 matlab yalmip kkt 双层优化问题
    • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体