We have a number of processor slots in a row. The processors are each dedicated to a single task that they can complete before going into a busy-looping mode while they wait for the next instruction.
A processor can run at 100% speed if it has enough cooling, and that requires there be no adjacent processor. If a processor has 1 adjacent processor, it only runs at 60% of maximum speed. If it has 2 adjacent processors it can only run at 30% of maximum speed.

Illustration of Sample Input 2.
We know how many seconds each task will take running on a processor at full speed, starting from $$$t=0$$$, and need to allocate tasks to processors to ensure the last task finishes as soon as possible.
Output the minimum time by which all of the tasks can be finished.
The output must be accurate to an absolute or relative error of $$$10^{-6}$$$.
4 51 1000 1 1
1000
7 105 2 3 5 4 6 7
8.33333333
| Название |
|---|


