21987_WormonanApple

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

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

Pro.ID

21987

Title

Worm on an Apple

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    An apple has the shape of a perfect sphere with the radius equal to 1. There is a worm located at some point A on the surface of the apple. The worm wants to move to the point B, also located on the surface of the apple. The worm may move in two fashions:

    - to crawl along the surface of the apple with the constant speed v0;

    - to gnaw a wormhole in the shape of a straight line segment from point A to point B.

    The inside of the apple consists of a core surrounded by the pulp. The core of the apple is also a perfect sphere, with the radius equal to P, and the center in the center of the whole apple. The worm can gnaw through the core with the speed v1 and through the pulp with the speed v2.

    Determine the minimal time the worm needs to get from the point A to the point B. The size of the worm can be neglected.

    输入

    The first line contains the values of P (0 < P < 1, the value is given with up to 3 decimal places), v0, v1, and v2 (integers in the range from 1 to 100). The second and the third line give the points A and B, respectively, as two angles in the spherical coordinate system. The first angle, the azimuth φ (0 ≤ φ < 360°), gives the angle between the X axis and the projection on the XY plane of the segment connecting the origin to the corresponding point. The second angle, the polar θ (0 ≤ θ ≤ 180°), gives the angle between the Z axis and the segment connecting the origin to the corresponding point. The values φ and θ are integers and given in degrees. In all test cases where θ = 0 or θ = 180, φ is given as 0.

    输出

    Description

    An apple has the shape of a perfect sphere with the radius equal to 1. There is a worm located at some point A on the surface of the apple. The worm wants to move to the point B, also located on the surface of the apple. The worm may move in two fashions:

    - to crawl along the surface of the apple with the constant speed v0;

    - to gnaw a wormhole in the shape of a straight line segment from point A to point B.

    The inside of the apple consists of a core surrounded by the pulp. The core of the apple is also a perfect sphere, with the radius equal to P, and the center in the center of the whole apple. The worm can gnaw through the core with the speed v1 and through the pulp with the speed v2.

    Determine the minimal time the worm needs to get from the point A to the point B. The size of the worm can be neglected.

    Input

    The first line contains the values of P (0 < P < 1, the value is given with up to 3 decimal places), v0, v1, and v2 (integers in the range from 1 to 100). The second and the third line give the points A and B, respectively, as two angles in the spherical coordinate system. The first angle, the azimuth φ (0 ≤ φ < 360°), gives the angle between the X axis and the projection on the XY plane of the segment connecting the origin to the corresponding point. The second angle, the polar θ (0 ≤ θ ≤ 180°), gives the angle between the Z axis and the segment connecting the origin to the corresponding point. The values φ and θ are integers and given in degrees. In all test cases where θ = 0 or θ = 180, φ is given as 0.

    Output

    The first and only line of the output should contain the minimal time of travel, accurate to 10-9.

    Sample Input

    Sample #1
    0.5 10 15 20
    0 0
    0 180


    Sample #2
    0.5 20 5 2
    0 0
    0 180

    Sample Output

    Sample #1
    0.116666667

    Sample #2
    0.157079633

    Source

    样例输入

    Sample #1
    0.5 10 15 20
    0 0
    0 180


    Sample #2
    0.5 20 5 2
    0 0
    0 180

    样例输出

    Sample #1
    0.116666667

    Sample #2
    0.157079633

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部