eolymp
bolt
Try our new interface for solving problems
Problems

Arc on the sphere

Arc on the sphere

On the surface of the planet is a ball of radius \textbf{R}, given two points for its latitude and longitude. Find the minimum path length along the surface of this planet from one point to another. \InputFile The first line is the number of R, the second line are given the latitude and longitude of first point in the third row - latitude and longitude of second point. Latitude in degrees from \textbf{-90} to \textbf{90}, longitude in degrees from \textbf{-180} to \textbf{180}, \textbf{100} ≤ \textbf{R} ≤ \textbf{10000}, all numbers are real. \OutputFile Print the length of the path with the two characters after the decimal point.
Time limit 1 second
Memory limit 64 MiB
Input example #1
4000
45 120
0 120
Output example #1
3141.59