아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Clearing Space

시간 제한3초메모리 제한1024 MB

요약
반지름 1km인 원 위의 n개 지점 중 최대 p개를 골라 넓이가 가장 큰 다각형을 만든다.
난이도

보통10점 중 6점

유형
기하, 동적 계획법, 조합론
정답자
아직 제출이 없습니다

문제

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 11km-radius clearing, nn (3≤n≤1003 \le n \le 100).
  • One line containing the integer number of fence posts you have, pp (3≤p≤n3 \le p \le n).
  • One line containing nn distinct real numbers a_1,…,a_na\_1, \ldots, a\_n in ascending order, the angles in degrees of each of the safe places to add fence posts (0≤a_i<3600 \le a\_i < 360).

출력

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

The output must be accurate to an absolute or relative error of 10−610^{-6}.

As a reminder, the radius of the clearing is 11km.

예제1

  1. 예제 1

    입력
    5
    4
    0 120 180 240 270
    
    예상 출력
    1866025.40378443866