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

18924번 - Fox Labeling 스페셜 저지다국어

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

문제

Bytica works in the biological expedition. Now she got $n$ colored foxes for experiments. There's a problem, however: foxes of the same color are absolutely indistinguishable.

Now Bytica wants to mark the foxes with colored labels. She repeats the following steps until each pair of foxes becomes distinguishable:

  • select some color that has not yet been used (not even as the natural color of some fox),
  • get $k$ random foxes from the cage (each subset of size $k$ is equally likely to be chosen),
  • mark each of them with a label of the selected color.

Each procedure (three steps) takes exactly one minute.

Two foxes are considered to be distinguishable if their colors differ or sets of colors of their labels differ.

The only thing Bytica is unsure about now is the expected time before all foxes will be pairwise distinguishable. So she asked you to write a program to compute this value.

입력

Input consists of two lines. The first line contains two integers $n$ and $k$ (1ドル \le k < n \le 30$). The second line contains $n$ integers, the $i$-th integer describes the initial color of the $i$-th fox.

Colors are denoted by positive integers not exceeding 1000ドル$.

출력

Print one real number: the expected time in minutes before each pair of foxes becomes distinguishable. Your answer will be considered correct if its relative or absolute error is within 10ドル^{-6}$.

제한

예제 입력 1

2 1
20 20

예제 출력 1

1.000000

예제 입력 2

2 1
15 1000

예제 출력 2

0.000000

힌트

출처

Camp > Bytedance-Moscow Workshops Camp > Bytedance-Moscow Workshops Camp 2020 > Contest 1 F번

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

출처

대학교 대회

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

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