Boxes
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

There're boxes in front of you. You know that each box contains a ball either in white or in black. The probability for a ball to be white is , and the colors of balls are independent of each other. The PJ King invites you to guess the colors of all balls. PJ King has assigned some costs to the boxes. If we number the boxes from to , the cost to open the box is w_i, and after a box is opened you can see the ball inside this box.

For sure, there's no way to know all the colors except by opening all boxes. However, Gromah wants to give you some hints. Gromah can tell you secretly the number of black balls among all boxes that have not been opened yet, but you have to pay cost to get one such hint from Gromah. Anyway, if you're superpowered, you can do it without any hint. What's the mathematical expectation of the minimum cost to figure out all colors of balls?

输入描述:

The first line contains an integer  and a decimal , representing the number of boxes and the cost to get a hint from Gromah.

The second line contains decimals .

All decimal numbers in the input have at most six decimal places.

输出描述:

Output one line with the expected minimum cost. Your answer will be considered to be correct if the relative or absolute error is less than .
示例1

输入

复制
2 0.1
1 1

输出

复制
0.6

说明

For the first test case, you can pay 0.1_{} cost to get a hint from Gromah. If the number of black balls is 0_{} or 2_{}, you will know the colors in each box. This case has a probability of \frac{1}{2}. Otherwise, you will know that the colors of the two balls are distinct, so you only have to open any of the boxes. Therefore, the expected cost is 0.1 + \frac{1}{2} \times 1 = 0.6.
示例2

输入

复制
4 0.123456
1 1 1 1

输出

复制
2.248456