{"raw_statement":[{"iden":"statement","content":"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. \n\nThe 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).\n\nOutput 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. \n\n"},{"iden":"input","content":"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)."},{"iden":"output","content":"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. "},{"iden":"examples","content":"Input3100 100 100Output57.73502737Input3100 51 51Output-1Input3100 100 51Output51.70946020"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of segments, with $ 3 \\leq n \\leq 100 $.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of positive real numbers representing the lengths of the segments, where $ 1 \\leq a_i \\leq 100 $.\n\n**Constraints**  \n1. $ n \\geq 3 $  \n2. $ a_i > 0 $ for all $ i \\in \\{1, \\dots, n\\} $  \n3. The segments must form a convex polygon inscribed in a circle with center inside the polygon.\n\n**Objective**  \nFind the minimal radius $ R > 0 $ such that there exists a convex cyclic polygon with side lengths $ a_1, a_2, \\dots, a_n $, inscribed in a circle of radius $ R $, and the center of the circle lies strictly inside the polygon.  \n\nIf no such $ R $ exists, output $ -1 $.\n\nThe radius $ R $ must satisfy:  \n$$\n\\sum_{i=1}^n \\arcsin\\left(\\frac{a_i}{2R}\\right) = \\pi\n$$  \nwith the condition that $ \\frac{a_i}{2R} \\leq 1 $ for all $ i $, and $ R \\geq \\frac{\\max(a_i)}{2} $.  \n\nAdditionally, the polygon inequality must hold:  \n$$\n\\max(a_i) < \\sum_{j \\neq i} a_j \\quad \\text{for all } i\n$$  \n(Otherwise, output $ -1 $.)","simple_statement":"Given N line segments, find the smallest radius R of a circle such that you can form a convex polygon using all segments as sides, with all vertices on the circle and the circle’s center inside the polygon. If impossible, output -1.","has_page_source":false}