402654: GYM100834 C Polycarp and Polygon

Memory Limit:512 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Polycarp and Polygontime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

Polycarp has N segments, where length of i-th one is ai. He wants to find the minimal radius R of a circle, such that we can construct a convex polygon from the segments, all vertexes of the polygon belongs to circumference of the circle, and center of the circle is inside the polygon. You should find that radius, if it is possible.

Input

The first line contains N — the number of segments (3 ≤ N ≤ 100). The second line contains N integer numbers ai — the lengthes of segments (1 ≤ ai ≤ 100).

Output

Output the minimal radius R. If it is not exists then output -1. You may assume that answers is coparated with the precision of 10 - 6.

ExamplesInput
3
100 100 100
Output
57.73502737
Input
3
100 51 51
Output
-1
Input
3
100 100 51
Output
51.70946020

加入题单

上一题 下一题 算法标签: