P26618 [AtCoder] Blind Purchase
省选
题目描述

Problem Description

Tenkaichi Toys is a famous toy store known for its cheap figures. The store handles $ N $ types of figures, which we will call Figure $ 1 $, Figure $ 2 $, ..., Figure $ N $ in this problem.

On the first floor, figures are sold individually, and Figure $ i $ $(1\ ≦\ i\ ≦\ N)$ can be bought for $ P_i $ yen per piece.

On the second floor, there is a figure vending machine. Inserting $ G $ yen into this machine will dispense one figure chosen uniformly at random from all $ N $ types. Since the machine manufactures figures automatically, the probability of each figure being dispensed is always $ 1/N $.

You have visited Tenkaichi Toys. Your goal is to obtain at least one of each of the $ N $ types of figures from this store. You can use the first and second floors in any order and as many times as you like. There is no upper limit on the amount of money you can spend. What is the minimum expected value of the total cost to acquire all figures?

Input Format

The input is given from the standard input in the following format:

$ N $ $ G $ $ P_1 $ $ P_2 $ ... $ P_N $

Output Format

Output the minimum expected value of the total cost to acquire all figures when following the optimal strategy.

The output will be considered correct if the absolute or relative error between your output and the judge's output is at most $ 10^{-6} $.

Sample Input and Output

Sample Input #1

2 4
5 6

Sample Output #1

9.5

Sample Input #2

3 10
5 6 7

Sample Output #2

18.0

Sample Input #3

3 1
5 6 7

Sample Output #3

5.5

Sample Input #4

10 2
3 3 3 3 5 5 5 7 7 10

Sample Output #4

36.830952380952381

Notes/Hints

Constraints

  • $2\ ≦\ N\ ≦\ 36$
  • $1\ ≦\ G\ ≦\ 36$
  • $1\ ≦\ P_i\ ≦\ 36$
  • All input values are integers.

Sample Explanation 1

There are $ 2 $ types of figures, and on the first floor, Figure $ 1 $ can be bought for $ 5 $ yen, and Figure $ 2 $ for $ 6 $ yen. Also, inserting $ 4 $ yen into the vending machine on the second floor will dispense one of the figures with equal probability. The optimal strategy here is to "first buy one figure from the vending machine, and then buy the remaining figure from the first floor." The expected cost of this strategy is $1/2\ ×\ 10\ +\ 1/2\ ×\ 9\ =\ 19/2$. No strategy can achieve an expected cost lower than $ 19/2 $.

Sample Explanation 2

Since the vending machine's price is high, it is optimal to buy all figures from the first floor.

Sample Explanation 3

Since the vending machine's price is low, it is optimal to keep buying figures from the vending machine until all figures are obtained.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 4 5 6
样例输出
9.5