logo AlgoBeat OnlineJudge
登录 注册

#214902. [NERC 2025] Jinx or Jackpot

内存限制:1024 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 integer choices each from 0 to 100. He picked an index () 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 . And he created it.

Jack knows the array of choices that suddenly appeared to the owner during the walk, but he does not know which the owner picked. However, the chosen index is fixed forever; the slot machine always uses the same as explained below.

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

  1. With probability it will be a jackpot, and the slot machine returns dollars to him, so he gains dollars.

  2. With probability it will be a jinx, and the slot machine returns nothing to him, so he loses 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 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 and () — the number of choices and the limit on the number of rounds. The second line contains integers () — 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 .

样例

样例输入 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