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

33460번 - Expected Distance 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB10000.000%

문제

Svetozar is passionate about robotics. He loves to test his robots on a flat, perfectly round platform in his backyard. Today, he invited $n$ of his friends and positioned each of them at the edge of this platform (that is, on the circumference), each at different points.

Svetozar is now planning to position his new robot at some good point on the platform, and then command it to determine the $k$-th closest friend to the robot (if there are several, choose any) and walk straight to that friend. Svetozar calls a point on the platform good if there is no half-plane containing all his friends, the boundary of which passes through the given point.

Now Svetozar is interested in the expected distance the robot will travel if its initial point is equally likely to be chosen from all good points.

입력

The first line contains two integers $n$ and $k$ (3ドル \leq n \leq 100,ドル 1ドル \leq k \leq n$): the number of Svetozar's friends involved, and the parameter for the robot.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ (0ドル \leq a_i < 360 \cdot 10^3,ドル $a_i \ne a_j$ for $i \ne j$). Here, $a_i$ denotes the angle between the direction to the north and the direction from the center of the platform to Svetozar's $i$-th friend counterclockwise, in thousandths of a degree.

출력

Print a single real number: the expected distance, measured in radii of platform. The answer will be considered correct if its absolute or relative error does not exceed 10ドル^{-4}$.

제한

예제 입력 1

3 1
2023 122023 242023

예제 출력 1

0.607986406

예제 입력 2

3 2
122023 242023 2023

예제 출력 2

1.174556945

예제 입력 3

3 3
242023 2023 122023

예제 출력 3

1.376646683

예제 입력 4

9 9
8 24 43 539 982 4435 39982 44353 99824

예제 출력 4

1.046471608

예제 입력 5

3 1
998 244 353

예제 출력 5

0.002476278

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2024 > Day 5: Belarusian SU Contest H번

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

출처

대학교 대회

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

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