题号:NC236485
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld
题目描述
"Abstractions are fine, but I think people also have to breathe air and eat bread.'' is a quote from
Das Glasperlenspiel, or
The Glass Bead Game, a novel published in 1946 written by the German author Hermann Hesse.
You are playing with

distinct glass beads

in some order. In each step, you move exactly one bead to the front. The cost of moving the bead to the front is the number of beads before that bead. For example, if we move

in the list

the total cost is

and the resulting sequence of beads is

.
Suppose that at each step glass bead

is moved with probability

, where

. What is the limit of the expected cost of the

-th move, when

tends to infinity?
输入描述:
The first line contains an integer
(
).
The second line contains
real numbers
each with 6 digits of precision.
输出描述:
Output one real number, the answer.
Your answer will be considered correct if its absolute or relative error does not exceed
. Formally let your answer be
, jury answer be
. Your answer will be considered correct if
.
示例2
输入
复制
3
0.500000 0.250000 0.250000