#P13637. [NWRRC 2021] Journey in Fog

[NWRRC 2021] Journey in Fog

题目描述

Julia and Jane are two friends living at the opposite ends of a long narrow street of length LL.

Today, Julia needs to meet Jane and return home as soon as possible.

Jane has a list of speeds v1,v2,,vnv_1, v_2, \ldots, v_n. At time 00, Jane picks an integer ii from 11 to nn uniformly at random, and starts moving towards Julia at a constant speed of viv_i.

Julia is not as restricted in her movements, though. Starting from time 00, Julia can freely move along the street in any direction at any speed not exceeding VV. In particular, Julia can stay at the same place as long as she wants, move at speeds lower than VV, and change her speed at any moment.

It's foggy outside. Hence, Julia and Jane can not see each other unless they are at the same point of the street. Also note that Julia does not know Jane's speed, but she knows the list v1,v2,,vnv_1, v_2, \ldots, v_n.

Suppose Julia meets Jane and arrives back home at time tt. Julia will follow a strategy that minimizes the expected value of tt. Find that expected value.

输入格式

The first line contains three integers nn, LL, and VV --- the number of speeds on Jane's list, the length of the street, and Julia's maximum speed (1n1051 \le n \le 10^5; 1L1091 \le L \le 10^9; 1V1061 \le V \le 10^6).

The second line contains nn integers v1,v2,,vnv_1, v_2, \ldots, v_n --- the list of possible speeds of Jane in ascending order (1v1<v2<<vn1061 \le v_1 < v_2 < \dotsb < v_n \le 10^6).

输出格式

Print a single real number --- the expected amount of time it will take Julia to meet Jane and return back home, if she follows an optimal strategy. Your answer will be considered correct if its absolute or relative error doesn't exceed 10910^{-9}.

1 1000 30
10
50.0000000000000
1 1000 10
30
33.3333333333333
4 1000 20
10 20 30 40
46.2500000000000

提示

In the first example test, Julia is much faster than Jane. It's best for Julia to move towards Jane as fast as she can, meet her at time 2525 at distance 750750 away from home, and return back home at time 5050.

In the second example test, Jane is much faster than Julia. It's best for Julia to just wait for Jane at home, where Jane will arrive at time 100030\frac{1000}{30}.