22384_GreatCircle

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

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

Pro.ID

22384

Title

Great Circle

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    Airplanes fly close to the Great Circle Route between two cities. The Great Circle Route is the shortest arc concentric with the earth that joins the two cities; that is, the shortest distance between the two cities following the surface of the earth.

    Given the latitude and longitude of two cities, find the most northerly latitude reached on the Great Circle Route between the cities. Print "undefined" if there is no unique answer.

    输入

    The first line of input contains N, the number of test cases. N lines follow, one for each case, containing the latitude and longitude of the two cities, in degrees, minutes, and direction. [A minute is 1/60 degree; Points on the equator have latitude denoted 0,0N (not 0,0S); points on the poles have longitude denoted 0,0W; points with 180 degrees longitude are denoted 180,0W (not 180,0E).]

    输出

    Description

    Airplanes fly close to the Great Circle Route between two cities. The Great Circle Route is the shortest arc concentric with the earth that joins the two cities; that is, the shortest distance between the two cities following the surface of the earth.

    Given the latitude and longitude of two cities, find the most northerly latitude reached on the Great Circle Route between the cities. Print "undefined" if there is no unique answer.

    Input

    The first line of input contains N, the number of test cases. N lines follow, one for each case, containing the latitude and longitude of the two cities, in degrees, minutes, and direction. [A minute is 1/60 degree; Points on the equator have latitude denoted 0,0N (not 0,0S); points on the poles have longitude denoted 0,0W; points with 180 degrees longitude are denoted 180,0W (not 180,0E).]

    Output

    For each case your program should produce one line of output giving the most northerly latitude reached, in the given format. Round your answer to the nearest minute.

    Sample Input

    3
    50,13N 45,10W 75,0N 44,50E
    50,13N 90,10W 75,0N 89,50E
    10,0N 129,30E 10,0S 50,30W

    Sample Output

    75,41N
    90,0N
    undefined

    Source

    样例输入

    3
    50,13N 45,10W 75,0N 44,50E
    50,13N 90,10W 75,0N 89,50E
    10,0N 129,30E 10,0S 50,30W

    样例输出

    75,41N
    90,0N
    undefined

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部