{"problem":{"name":"C. Polycarp and Polygon","description":{"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 b","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":524288},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10083C"},"statements":[{"statement_type":"Markdown","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## Input\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\n## Output\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[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**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 $.)","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10083C","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}