아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Jet Set

시간 제한1초메모리 제한1024 MB

요약
측지선 최단 호로 이은 웨이포인트 경로가 모든 경선을 지나는지 판정하고, 지나지 않으면 소수점이 .0 또는 .5인 빠진 경도를 출력한다.
난이도

보통10점 중 6점

유형
기하, 수학, 구현
정답자
아직 제출이 없습니다

문제

Your wealthy friends love to brag about all their travelling. Every time you see them, they have visited some new exotic place you have never heard of. All of them are all too happy to tell you they have been all around the world---but you're not so sure about that. Have these jetsetters made a real circumnavigation?

There exist many different definitions of what exactly constitutes a circumnavigation, but for the purposes of this problem we consider a circumnavigation a journey starting and ending at the same point and visiting all meridians (lines of longitude) along the way. Note that the North and South Pole are part of every meridian.

Figure 1: Illustration of Sample Input 1, giving a circumnavigation starting and ending in Reykjavík, with additional waypoints in Athens, Jakarta, Honolulu and Chicago.

Amelia, one of your rich friends, gave you a log of her flights in the form of a list of waypoints. Her trip started at the first waypoint, visited the remaining waypoints in order, and finally went back from the last waypoint to the first. Between consecutive waypoints, Amelia always travelled along the shortest circular arc connecting the two points. Find out whether Amelia's trip can be considered a circumnavigation in the above sense, and if not find a meridian that Amelia never visited. In that case, always report exactly an integer-valued or half-integer-valued meridian.

입력

The input consists of:

  • One line with an integer nn (2≤n≤1,0002 \le n \le 1\\,000), the number of waypoints.
  • nn lines, each with two integers ϕ\phi and λ\lambda (−90<ϕ<90,−180≤λ<180-90 < \phi < 90, -180 \le \lambda < 180), the latitude and longitude of one of the waypoints.

No two consecutive waypoints along the route are equal or antipodes (opposite points on the sphere) of each other.

출력

If the route is a valid circumnavigation, output yes. Otherwise, output no, followed by a longitude λ\lambda (−180≤λ<180-180 \le \lambda < 180) which the route never visited. The longitude must end in either .0 or .5.

예제3

  1. 예제 1

    입력
    5
    64 -22
    38 24
    -6 107
    21 -158
    42 -88
    
    예상 출력
    yes
    
  2. 예제 2

    입력
    2
    80 30
    75 -150
    
    예상 출력
    yes
    
  3. 예제 3

    입력
    4
    45 0
    0 -170
    -45 0
    0 170
    
    예상 출력
    no 173.5