Four spark chambers are installed along the large meson collider, which monitors the interactions of mesons moving in a circle at high velocities.
In order to receive reliable synchronized data from spark chambers and process it quickly, it is required to place 2 computers inside the circle, connect them via a cable to each other, as well as to the spark chambers. Each camera must be connected to at least one computer. The task is to minimize the total length of the cable for maximum synchronization.
Write a program that calculates the cable length using the known location of the spark chambers.
In the first line, five integers are entered, separated by spaces, R is the radius of the circle along which the mesons move ($$$1 \leq R\leq 100$$$), $$$g_1$$$, $$$g_2$$$, $$$g_3$$$, $$$g_4$$$ are the angles at which spark chambers are visible from the center of the circle ($$$60^\circ \leq g_i \leq 360^\circ$$$).
Print the total length of the required cable. Your answer will be accepted if absolute or relative error does not exceed $$$10^{-6}$$$.
Formally, let your answer be $$$a$$$, and the jury's answer be $$$b$$$. Your answer is considered correct if $$$\frac{|a-b|}{\max(1, |b|)} \leq 10^{-6}$$$.
10 60 120 60 120
34.64101615
Illustration for test