- Time limit: 1.00 s
- Memory limit: 512 MB
Uolevi is playing Wario kart again. The racing track contains boost pads numbered . The cars move normally at speed but the -th pad multiplies the car's speed by for one second if a player chooses to use it. The player can not pick up other boosts while one is in effect. After the boost ends, a player can also not use the next boost pads they pass. The -th pad lies at distance meters from the starting line. The finishing line lies at distance meters.
Last time Uolevi blue-shelled Maija so bad she isn't coming over to play any time soon. Uolevi is left to play alone and he is trying to finish the track as fast as possible. Help him find the theoretical fastest time achievable. Note that the track is not considered to be cyclic.
Input
The first line contains two integers and . The second line contains integers .
Output
Print the minimum time required to finish the track in seconds. The answer is considered correct if the error is less than .
Constraints
- All input values are integers
Example 1
Input:
5 1 3 2 2 2 2
Output:
2.5
Explanation:
Uolevi picks boosts 0 and 4
Example 2
Input:
4 0 2 2 2 2
Output:
2
Example 3
Input:
10 2 2 4 5 3 2 31 71 5 2 4
Output:
4.16129032258064516115