22132_Emergentescape

2022-5-16 18:21| 发布者: Hocassian| 查看: 21| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506135298200-Problem List-采集的数据-后羿采集器.html

Pro.ID

22132

Title

Emergent escape

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22132

AC

15

Submit

169

Ratio

8.88%

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    In the year 23XX, spaceship is very popular used in transmission of the universe. People live not only on the earth, but also on many other planets. I am an astronaut, professionally speaking, a captain. I have my own spaceship, which names "ZEPHYR". My job is that exploring the galaxy, detecting the mines and gas, collecting the swatch and bringing them to the earth.

    I love my job. It is so excited that traveling through the stars. I'm always accidentally meeting many graceful things I have never seen before, but sometimes it is not so good when bad lucks fall off.

    One day, when I am driving my spaceship, dangers happened. I find that I have gone a wrong way, there are lots of aerolites in my frontage, and they are gonna to strike my spaceship within a few seconds. I try to control the ship to avoid hitting, but there are really too much aerolites. Finally, my spaceship is badly damaged. Oh, my "ZEPHYR"!

    But there is no time to be sad. I hear the warning of the computer: "Emergency! The spaceship is going to explode!" I have to escape immediately! There is a life-ship in a comer of the spaceship. Now I am in the controlling room, another side of the spaceship. Do I have chance to get away?

    Seeing from frontward to backward, "ZEPHYR" is shaped as a circle, we defined the coordinates of the center of the circle is (0, 0), the radius is R, and the angle of the East is 0° , the angle of the North is 90° . My computer has detected out there are N aerolites stroke my spaceship. Each aerolite is also shaped as a circle, with location coordinates (xi, yi), and radius ri. If it hits my spaceship, it leaves a hole as its shape, so I cannot get through it. The controlling room and the life-ship are all on the circumference (Compared with the huge spaceship, you could assume both of them as a point), with their angles d1 and d2, anti-clockwise from East. Tell me whether I can get to the life-ship. I can go to everywhere in my spaceship, except the hole hit by the aerolites (Even the edge of the hole).

    输入

    The first line of input there is one integer T ( T ≤ 100 ), giving the number of test cases in the input. Each test case starts with a line containing three real number R, d1, d2 ( 0 < R ≤ 10000, 0 ≤ d1, d2 < 360, d1d2 ), representing the radius of the spaceship, and the degree of the two place on the circumference. Next line is a positive integer N ( 0 < N ≤ 1000 ), the number of the aerolites. Then N lines each line comes with a coordinate ( xi, yi ), and radius ri, all of them are real number, ( -10000 ≤ xi, yi ≤ 10000, 0 < ri ≤ 10000). There is a blank line between each test case.

    Note that some aerolites may not strike on the spaceship, and some aerolites may directly strike on the controlling room or life-ship, even the edge of the aerolites (How poor! Then you die hard!).

    输出

    Description

    In the year 23XX, spaceship is very popular used in transmission of the universe. People live not only on the earth, but also on many other planets. I am an astronaut, professionally speaking, a captain. I have my own spaceship, which names "ZEPHYR". My job is that exploring the galaxy, detecting the mines and gas, collecting the swatch and bringing them to the earth.

    I love my job. It is so excited that traveling through the stars. I'm always accidentally meeting many graceful things I have never seen before, but sometimes it is not so good when bad lucks fall off.

    One day, when I am driving my spaceship, dangers happened. I find that I have gone a wrong way, there are lots of aerolites in my frontage, and they are gonna to strike my spaceship within a few seconds. I try to control the ship to avoid hitting, but there are really too much aerolites. Finally, my spaceship is badly damaged. Oh, my "ZEPHYR"!

    But there is no time to be sad. I hear the warning of the computer: "Emergency! The spaceship is going to explode!" I have to escape immediately! There is a life-ship in a comer of the spaceship. Now I am in the controlling room, another side of the spaceship. Do I have chance to get away?

    Seeing from frontward to backward, "ZEPHYR" is shaped as a circle, we defined the coordinates of the center of the circle is (0, 0), the radius is R, and the angle of the East is 0° , the angle of the North is 90° . My computer has detected out there are N aerolites stroke my spaceship. Each aerolite is also shaped as a circle, with location coordinates (xi, yi), and radius ri. If it hits my spaceship, it leaves a hole as its shape, so I cannot get through it. The controlling room and the life-ship are all on the circumference (Compared with the huge spaceship, you could assume both of them as a point), with their angles d1 and d2, anti-clockwise from East. Tell me whether I can get to the life-ship. I can go to everywhere in my spaceship, except the hole hit by the aerolites (Even the edge of the hole).

    Input

    The first line of input there is one integer T ( T ≤ 100 ), giving the number of test cases in the input. Each test case starts with a line containing three real number R, d1, d2 ( 0 < R ≤ 10000, 0 ≤ d1, d2 < 360, d1d2 ), representing the radius of the spaceship, and the degree of the two place on the circumference. Next line is a positive integer N ( 0 < N ≤ 1000 ), the number of the aerolites. Then N lines each line comes with a coordinate ( xi, yi ), and radius ri, all of them are real number, ( -10000 ≤ xi, yi ≤ 10000, 0 < ri ≤ 10000). There is a blank line between each test case.

    Note that some aerolites may not strike on the spaceship, and some aerolites may directly strike on the controlling room or life-ship, even the edge of the aerolites (How poor! Then you die hard!).

    Output

    For each test case, output a string:

    "Escape!", if you could reach the life-ship.

    "Die hard!", if you fail to reach the life-ship, or the controlling room or life-ship is directly struck by some aerolites.

    Sample Input

    2
    10 240 45
    4
    0 0 7
    -7 7 4
    15 5 3
    6 -5 2
    1 0 1
    1
    0 0 10000

    Sample Output

    Escape!
    Die hard!

    Hint

    Figure 1 shows the first sample case. You can escape in this situation.

    Figure 1   The first sample case

    Source

    样例输入

    2
    10 240 45
    4
    0 0 7
    -7 7 4
    15 5 3
    6 -5 2
    1 0 1
    1
    0 0 10000

    样例输出

    Escape!
    Die hard!

    提示

    Figure 1 shows the first sample case. You can escape in this situation.

    Figure 1   The first sample case


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部