Flygskam
시간 제한2초메모리 제한1024 MB
구 위의 공항 좌표와 양방향 항공로가 주어질 때, 시작 공항에서 목표 공항까지 대권 거리에 편당 100의 패널티를 더한 최소 수치심을 구한다.
문제
At one of the many climate protests, Skylar fell in love with a fellow environmental activist. Unfortunately, the two young lovers live on opposite sides of the planet and long distance travel is only practical by (gasp) air. Skylar had scolded friends and family for flying, heavily handing out the recent Swedish export flygskam (verbatim translation: flight shame). But alas, the things we do for love! Now they want your help to calculate the minimum amount of flygskam Skylar will accumulate on a one-way trip across the globe.
To calculate the best route you models the planet as a perfect sphere and assumes that all flights fly at the distance km from the center of the earth. The amount of shame for a single point-to-point flight is calculated as the distance between the airports in km, plus a take-off and landing penalty of , that is, two airports with the flight distance km will result in shame.
The positions of the airports are given as the latitude and longitude in (decimal) degrees. The latitude of a point on the earths surface is the angle between the equatorial plane and a line passing through and the center of the earth. The equator has latitude , points north of the equator has positive values and points south of the equator has negative values, the North Pole has latitude and the South Pole latitude . Half circles that run from the North to the South pole are called meridians. The zero meridian runs through Greenwich. The longitude of a point is the angle between the zero meridian plane and the line that run through and the center of the earth, with values from to , with positive values east of Greenwich.
입력
Input starts with one line with two integers , the number of airports and , the number of two-way flight routes. The second line has two strings and , Skylar's start position and Skylar's target position. Then follows lines, each starts with a three letter (uppercase) airport code, followed by two real values numbers, the latitude and longitude in degrees. Then follows lines, each with two strings and , the airports with a two-way flight connection.
All flight airports have unique names and all connections are between existing airports.
출력
Output a real value with the minimum amount of flygskam Skylar will obtain on a one-way trip. If the target is unreachable and Skylar will be forever alone, output -1. Answers within a relative or absolute error of will be accepted.