Hide

Problem I
Mr. Noodle

/problems/mrnoodle/file/statement/en/img-0001.jpeg
Chef Mario in his restaurant.
Inspired by his visit to UCLA, Mario is attempting to launch his new Italian restaurant, “Mr. Noodle”. His specialty dish is straight noodles!

To make the dishes interesting, Mario arranges the straight noodles into convex polygon shapes. To serve the dish, Mario wants to plate the polygon on the smallest possible plate, for aesthetic purposes.

Mario has $N$ pieces of straight noodles, with length $a_ i$, for $i=1, 2, \dots , N$. Find the minimum radius, $r$, such that there exists a convex polygon with side lengths $a_ i$ that fits in a circle of radius $r$. It is guaranteed that there exists a non-degenerate convex polygon with side lengths $a_ i$.

Input

The first line of input contains one integer $N$ $(3 \leq N \leq 100,000)$, representing the number of line segments. The second line contains $N$ spaced integers $a_1, a_2, \dots , a_ N$ $(1 \leq a_ i \leq 10^9)$, representing the side lengths of the noodles.

Output

Output one line consisting of a single double $r$, the minimum possible radius. The answer will be considered correct if the relative difference does not exceed $10^{-6}$.

Sample Input 1 Sample Output 1
4
1 1 1 1
0.7071067812
Sample Input 2 Sample Output 2
5
2 3 4 5 6
3.52095745

Please log in to submit a solution to this problem

Log in