eolymp
bolt
Try our new interface for solving problems
Problems

Gandhi and Dundee

Gandhi and Dundee

Gandhi went to Dundee. Gandhi is a handful, don’t mess with Gandhi. Gandhi will eat whatever he can reach on his way. He can reach all points which are within his eating radius from a certain point on his way. He’s taking the shortest route from the point \textbf{A} to Dundee, which is, on planet Earth, is a large-diameter arch passing through his start and end points. The arch is not larger than a half of the big circle. The distance to the edible points is measured along the surface of the Earth. We must find the surface area of the territory where no decent person should go to avoid being eaten by Gandhi. \InputFile The first line of the input file contains six real numbers \textbf{x_0}, \textbf{y_0}, \textbf{x_1}, \textbf{y_1}, \textbf{R}, \textbf{eps} --- the latitude and longitude of the beginning point of the interval (in degrees) and, correspondingly, of the ending point, as well as the radius of Earth and Gandhi’s eating radius (\textbf{--90} ≤\textbf{x_0}, \textbf{x_1} ≤ \textbf{90}, \textbf{--180} ≤ \textbf{y_0}, \textbf{y_1} ≤ \textbf{180}, \textbf{1} ≤ \textbf{R} ≤ \textbf{10000}, \textbf{0} ≤ \textbf{eps} ≤ \textbf{R}). \OutputFile The output file must contain a single real number -- the surface area of the dangerous territory with absolute or relative error within \textbf{10^\{--8\}}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
-90 5 90 -100 10 5
Output example #1
378.1490948518
Source XIII All-Siberian Programming Contest named after I.V.Pottosin, November 11, 2012