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

35048번 - Jinx or Jackpot 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 2048 MB87787.500%

문제

Jack is in his favourite casino and has 1000ドル$ dollars. The casino has literally nothing but a single slot machine. Jack knows the history of this casino. Once upon a time, the future owner of the casino was walking and suddenly saw an array of $n$ integer choices $p_{1}, \dots, p_{n}$ each from 0ドル$ to 100ドル$. He picked an index $i$ (1ドル \leq i \leq n$) uniformly at random and thought that it was a good idea to create a casino in which there is only one slot machine with jackpot probability of $\frac{p_i}{100}$. And he created it.

Jack knows the array of choices $p_{1}, \dots, p_{n}$ that suddenly appeared to the owner during the walk, but he does not know which $i$ the owner picked. However, the chosen index $i$ is fixed forever; the slot machine always uses the same $p_i$ as explained below.

On the slot machine, Jack can bet $x$ dollars, where $x$ is a non-negative integer, and pull the lever. Then:

  1. With probability $\frac{p_i}{100}$ it will be a jackpot, and the slot machine returns 2ドルx$ dollars to him, so he gains $x$ dollars.
  2. With probability 1ドル - \frac{p_i}{100}$ it will be a jinx, and the slot machine returns nothing to him, so he loses $x$ dollars.

Even if Jack bets 0ドル$ dollars, he will understand whether it was a jinx or a jackpot.

Also, the slot machine is not very durable, so Jack can play at most $k$ rounds on it.

Find the maximum expected profit Jack can achieve by an optimal strategy. Here a profit is defined as the final amount of money Jack has minus his initial 1000ドル$ dollars.

Of course, Jack can't make a bet that is more than his current balance.

입력

The first line contains two integers $n$ and $k$ (1ドル \leq n \leq 100,000円$; 1ドル \leq k \leq 30$) --- the number of choices and the limit on the number of rounds. The second line contains $n$ integers $p_{1}, \dots, p_{n}$ (0ドル \le p_i \le 100$) --- the choices.

출력

Output a single real number --- the expected profit Jack can achieve by an optimal strategy. Your answer will be considered correct if its absolute or relative error is at most 10ドル^{-4}$.

제한

예제 입력 1

2 2
70 30

예제 출력 1

160

예제 입력 2

2 30
30 70

예제 출력 2

12099716.1778528057038784

예제 입력 3

2 5
40 50

예제 출력 3

0

예제 입력 4

6 6
10 20 60 30 40 50

예제 출력 4

29.40799999999990177457221

예제 입력 5

1 5
61

예제 출력 5

1702.708163199999489734182

노트

출처

ICPC > Regionals > Northern Eurasia > Northern Eurasia Finals > Northern Eurasia Finals 2025 J번

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

출처

대학교 대회

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

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