21422_ScorchedEar

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

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

Pro.ID

21422

Title

Scorched Earth

Title链接

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

AC

12

Submit

34

Ratio

35.29%

时间&空间限制

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

    The problem has been slightly simplified after the contest to fix some bugs and difficulties. The original problem had 0 ≤ d ≤ 180 and no limitation xu < xo.

    General Arne Heisveis is a victim of the constant cuts in funding for the Norwegian defence. There is basically no money available, and Arne is forced to spend his workdays in a dull office doing nothing.

    To avoid an unworthy death from boredom, one of Arne's colleagues found an old computer game called Scorched Earth, which the generals now play all day. The problem is that Arne is not very talented in this game, but still very competitive. He therefore wants you to write a program to help him cheat.

    A screen-shot from Scorched Earth is shown above. The generals' contest will be a series of battles between two players, and the only allowed weapons are small missiles. Each player controls a tank, and the objective is to destroy the opponents tank by shooting it. The players take turns in shooting, and control the angle and initial velocity of their missiles. The initial velocity can never exceed 300.0 m/s, and can of course never be negative.

    In order for a projectile to hit, it must avoid all the mountains in the field, and have the correct velocity and angle to hit the opponent. The gravity is always 9.8 m/s2, and there may also be wind. To keep things simple, we assume that the wind gives the projectile a constant acceleration.

    Arne is quite confident in finding an angle that will avoid all the mountains in the battlefield, but needs your help adjusting the velocity of the shot.

    输入

    The input has n ≤ 1000 cases, where n is given by the first line of input. Each test case is described by a line with 6 floating point numbers xu, yu, xo, yo, w, d. Your tank is positioned at (xu, yu) in meters, and your opponents at (xo, yo), where 0.0 ≤ xu < xo ≤ 1000.0 and 0.0 ≤ yu, yo ≤ 800.0.  The number -2.0 ≤ w ≤ 2.0 gives the acceleration in m/s2 of the projectile along the x-axis caused by the wind. The angle chosen by Arne is given by 0 < d < 78 in degrees. An angle d = 0 implies a shot along the increasing x-axis, and d = 90 would have implied a shot along the increasing y-axis.

    输出

    Description

    The problem has been slightly simplified after the contest to fix some bugs and difficulties. The original problem had 0 ≤ d ≤ 180 and no limitation xu < xo.

    General Arne Heisveis is a victim of the constant cuts in funding for the Norwegian defence. There is basically no money available, and Arne is forced to spend his workdays in a dull office doing nothing.

    To avoid an unworthy death from boredom, one of Arne's colleagues found an old computer game called Scorched Earth, which the generals now play all day. The problem is that Arne is not very talented in this game, but still very competitive. He therefore wants you to write a program to help him cheat.

    A screen-shot from Scorched Earth is shown above. The generals' contest will be a series of battles between two players, and the only allowed weapons are small missiles. Each player controls a tank, and the objective is to destroy the opponents tank by shooting it. The players take turns in shooting, and control the angle and initial velocity of their missiles. The initial velocity can never exceed 300.0 m/s, and can of course never be negative.

    In order for a projectile to hit, it must avoid all the mountains in the field, and have the correct velocity and angle to hit the opponent. The gravity is always 9.8 m/s2, and there may also be wind. To keep things simple, we assume that the wind gives the projectile a constant acceleration.

    Arne is quite confident in finding an angle that will avoid all the mountains in the battlefield, but needs your help adjusting the velocity of the shot.

    Input

    The input has n ≤ 1000 cases, where n is given by the first line of input. Each test case is described by a line with 6 floating point numbers xu, yu, xo, yo, w, d. Your tank is positioned at (xu, yu) in meters, and your opponents at (xo, yo), where 0.0 ≤ xu < xo ≤ 1000.0 and 0.0 ≤ yu, yo ≤ 800.0.  The number -2.0 ≤ w ≤ 2.0 gives the acceleration in m/s2 of the projectile along the x-axis caused by the wind. The angle chosen by Arne is given by 0 < d < 78 in degrees. An angle d = 0 implies a shot along the increasing x-axis, and d = 90 would have implied a shot along the increasing y-axis.

    Output

    Output for each test case a line with an initial velocity within the bounds which will ensure a hit, with 5 digits precision. If this is not possible, output a line with the text "impossible".

    Sample Input

    2
    0.0 0.0 500.0 0.0 0.0 45.0
    100.0 0.0 500.0 0.0 0.0 135.0

    Sample Output

    70.00000
    impossible

    Source

    样例输入

    2
    0.0 0.0 500.0 0.0 0.0 45.0
    100.0 0.0 500.0 0.0 0.0 135.0

    样例输出

    70.00000
    impossible

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部