Survival Route
시간 제한1초메모리 제한1024 MB
구면 위에서 O를 중심으로 한 반지름 r의 방사선 구역을 피해 B에서 A로 가는 최단 경로의 길이를 구한다.
문제
The surface of recently discovered planet i1c5l is a perfectly shaped sphere with radius . Earth’s aerospace forces sent a research module Waldemar-63 that was supposed to land on the planet’s surface at point . However, due to miscalculation, Waldemar-63 got to point instead. Fortunately, Waldemar series are equipped with a train of wheels that will help in getting to the initial destination point. Nevertheless, power capacity is quite limited so it is important to get to point by minimal distance run.
A major complication is that some point on the surface of the planet radiates waves of unknown origin. The waves spread inside the radius (the distance is measured on the surface). As the previous 62 missions show, any device that gets into the radiation area instantly breaks down. Thus, Waldemar-63’s route should avoid the radiation area. Find the minimal distance that the device has to undertake from to .
입력
The first line contains integers , (, ) --- coordinates (latitude and longitude in degrees) of point . Second line --- coordinates of point . Third --- three integers: coordinates of point and the radiation radius . In the fourth line --- positive integer not exceeding 1000 --- planet’s radius . It is guaranteed that points and are beyond the area of radiation.
출력
Output the distance determined. The answer is considered correct if the absolute or relative error is less than .