407378: GYM102780 B Mysterious Resistors

Memory Limit:64 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Mysterious Resistorstime limit per test0.4 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

When repairing an electronic board, Basil discovered that the board had already been under repair, and one of the resistors on it was replaced with a strange design. The design consisted of $$$k$$$ series of connected links, and each link in them — of two resistors connected in parallel.

Moreover, in each link, along with the typical resistor, with a clearly readable denomination, there was a resistor with a strange, non-standard marking. Having examined the non-standard resistors, Basil came to the conclusion that they were of the same type. However, he could not determine their value. The total resistance value of the entire circuit was equal to $$$R$$$ ohms. Having written out the nominal value of the known resistor for each link in the circuit, Basil received a series of integers $$$r_1$$$, $$$r_2$$$, ..., $$$r_k$$$.

Help Basil — write a program that calculates the value of the mysterious resistors from the total resistance of the circuit $$$R$$$, and the known values $$$r_1$$$, $$$r_2$$$, ..., $$$r_k$$$.

Input

The first line of the input data contains two integers $$$k$$$ ($$$1 \leq k \leq 1000$$$) and $$$R$$$ ($$$1 \leq R \leq 100000$$$), separated by a space.

The second line contains $$$k$$$ integers separated by spaces: $$$r_1$$$, $$$r_2$$$,..., $$$r_k$$$ ($$$1 \leq r_i \leq 100000$$$; $$$2R \leq r_1 + r_2 + \ldots + r_k$$$).

Output

The program should output a single number — the estimated value of the mysterious resistors. The value must be outputed with an accuracy of $$$10^{-6}$$$.

ExamplesInput
3 11
3 12 30
Output
6.00000000
Input
7 110
15 60 6 45 20 120 70
Output
30.00000000
Note

Recall that while connecting two resistors with the values of $$$R_1$$$ and $$$R_2$$$, the total resistance $$$R$$$ is calculated as $$$R = R_1 + R_2$$$ for the serial connection, and as $$$\dfrac{1}{R} = \dfrac{1}{R_1} + \dfrac{1}{R_2}$$$ for the parallel one.

加入题单

上一题 下一题 算法标签: