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.
InputThe 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).
OutputOutput 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.
ExamplesInput3Output
100 100 100
57.73502737Input
3Output
100 51 51
-1Input
3Output
100 100 51
51.70946020