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

30560번 - Clearing Space 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 1024 MB95281521.739%

문제

You are putting up an event space in Nottingham's Sherwood Forest by erecting a fence in a circular-shaped clearing you found that is exactly one kilometre in radius. You will put some fence posts in the trees around the edge of the clearing and then connect them together with fencing later.

You would like to put the fence around as much of the event space as possible. However, the ground is only suitable in a few places around the border, and you only have so many fence posts to put in the ground, so you'll have to choose carefully if you want to maximise area.

Figure C.1: An illustration of using 4 posts to capture the maximum area in sample input 1.

Knowing the safe places to put fence posts, and the number of posts you have, what is the maximum area of clearing you can enclose?

입력

  • One line containing the integer number of safe points around the 1ドル$km-radius clearing, $n$ (3ドル \le n \le 100$).
  • One line containing the integer number of fence posts you have, $p$ (3ドル \le p \le n$).
  • One line containing $n$ distinct real numbers $a_1, \ldots, a_n$ in ascending order, the angles in degrees of each of the safe places to add fence posts (0ドル \le a_i < 360$).

출력

Output the maximum area you can capture with a polygonal clearing made using at most $p$ fence posts, in square metres.

The output must be accurate to an absolute or relative error of 10ドル^{-6}$.

As a reminder, the radius of the clearing is 1ドル$km.

제한

예제 입력 1

5
4
0 120 180 240 270

예제 출력 1

1866025.40378443866

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2023 C번

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

출처

대학교 대회

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

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