eolymp
bolt
Try our new interface for solving problems
Problems

Alien Visit

Alien Visit

25 May, 1997, near Elcino-Borisovo place, Jandal region, strange signs were found in the field... Witness: \textit{"First, I saw only one UFO. It was shining with cold-blue light. Closer to the center of the object, the light was pink. It hung over the field, then began to blink and move intermittently round. The UFO was quite big. The second UFO came several minutes after the first. It had the same size as the first one. It seemed that there was some kind of contact between them ? they began to blink alternately."} Circles of scorched barley were found in the field. The circles were of the same radius, and their centers were lying on a straight line. You were hired to investigate the damage caused to the farms of Elcino-Borisovo place by the visit of aliens. In order to do this you are to calculate the total area of scorched barley. \InputFile The first line of the input contains two integers \textbf{n} and \textbf{r} denoting number of circles and the radius of the circles, respectively (\textbf{1} ≤ \textbf{n} ≤ \textbf{1000}, \textbf{1} ≤ \textbf{r} ≤ \textbf{100}). The next line contains \textbf{n} space separated integers \textbf{a_1}, \textbf{a_2}, ..., \textbf{a_n} ? the shifts of circles' centers relative to some origin (\textbf{0} ≤ \textbf{a_i} ≤ \textbf{5000}). All shifts are guaranteed to be distinct. \OutputFile Output the only real number ? the total area covered by these circles. Your answer must be truncated to five decimal places.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1 1
0
Output example #1
3.1415926536
Source ACM ICPC 2010-2011 NEERC Moscow Subregional