Logo
(追記) (追記ここまで)

21930번 - Jewelry Size 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB115585462.069%

문제

Figure E.1. Jewelry

She came up with a new jewelry design. The design uses two parts: a hollow circlet and a convex polygonal component. The design can be customized by specifying the edge lengths of the polygon, which should be multiples of a unit length, so that customers can embed memorial numbers in the jewelry. Note that there can be many different polygons with edges of the specified lengths. Among them, one with a circumscribed circle, that is, a circle that passes through all of its vertices, is chosen so that the polygonal component can be firmly anchored to the circlet

(a) (b) (c)

Figure E.2. (a) A pentagon with a circumscribed circle; (b) A pentagon with no circumscribed circle; (c) Another pentagon with no circumscribed circle

For example, Figure E.2(a) has a pentagon with its edge lengths of 3, 1, 6, 1, and 7 units, meaning March 16th and 17th. The radius of the circle is approximately 3.544 units. Figures E.2(b) and E.2(c) show pentagons with the same edge lengths but neither of them has a circumscribed circle.

To commercialize the jewelry, she needs to be able to compute the radius of the circumscribed circle from specified edge lengths. Can you help her by writing a program for this task?

입력

The input consists of a single test case of the following format.

n
x1 . . . xn

n is an integer that indicates the number of edges (3 ≤ n ≤ 1000). xk (k = 1, . . . , n) is an integer that indicates the length of the k-th edge (1 ≤ xk ≤ 6000).

You may assume the existence of one or more polygons with the specified edge lengths. You can prove that one of such polygons has a circumscribed circle.

출력

Output the minimum radius of a circumscribed circle of a polygon with the specified edge lengths. Absolute/relative error of the output should be within 10−7.

제한

예제 입력 1

5
3 1 6 1 7

예제 출력 1

3.54440435

예제 입력 2

3
500 300 400

예제 출력 2

250.0

예제 입력 3

6
2000 3000 4000 2000 3000 4000

예제 출력 3

3037.33679126

예제 입력 4

10
602 67 67 67 67 67 67 67 67 67

예제 출력 4

3003.13981697

예제 입력 5

3
6000 6000 1

예제 출력 5

3000.00001042

힌트

출처

ICPC > Regionals > Asia Pacific > Japan > ICPC 2020 Asia Yokohama Regional E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /