
Quite recently, the City of Barcelona has included trams in its efficient public transport. As expected, the result has been a nice set of accidents of outstanding originality and beauty. Diminishing aesthetic reasons, the Mayor of Barcelona has decided to reduce the delay caused by the accidents. After a thorough study, the following model has been established:
Every tram must go from an initial point \mathbf{P_0} to a final point \mathbf{P_n}, visiting the intermediate points \mathbf{P_1}, \ldots, \mathbf{P_{n-1}} in this order. For every 1 \leq i \leq n, let \mathbf{S_i} be the section going from \mathbf{P_{i-1}} to \mathbf{P_i}. Every such section must be traveled at a uniform speed v_i, which is chosen by the driver at \mathbf{P_{i-1}}. Let M_i be the maximum possible speed of the tram at S_i, and assume that the chosen speed is 0 < v_i \leq M_i. Then, the probability of crashing in S_i is v_i / M_i. When a crash happens, the tram uses an efficient recovery system that lasts only seconds. Afterwards, the tram reaches P_i using an auxiliary (slow but safe) engine, which provides a speed of meters per second and guarantees no more crashes in S_i.
For instance, assume that the section length is meters, and that the current maximum speed is meters per second. If the driver chooses to travel at m/s, the tram will crash for sure. Since the crash can happen anywhere between P_{i-1} and P_i, for the sake of computation we can assume that it will take place exactly at the midpoint (after meters). Therefore, on average, the tram will spend seconds to reach the midpoint, seconds to recover from the crash, and seconds to reach P_i, for a total of seconds. By contrast, if the tram starts traveling at m/s, with probability it will crash and spend 10 + 10 + 30 = 50 seconds, and with probability it will reach P_i after seconds without any crash. The average time in this case is thus just 0.6 \cdot 50 + 0.4 \cdot 20 = 38 seconds.
When the tram reaches every P_i, it stops for a few seconds regardless of having had a crash in S_i or not; these few seconds (for simplicity, we consider them to be ) are enough to (almost) repair the tram: the maximum speed reduces by m/s after every crash. If we call the initial maximum speed M_0, then we have M_i = M_0 - C_i, where 0 \leq C_i \leq i-1 is the total number of crashes suffered in S_1, \ldots, S_{i-1}.
Write a program that prints the optimal average travel time given the initial maximum speed and the length of every section.
Each line corresponds to one test case and contains the initial maximum speed M_0 (a real number between and ), the value of (an integer between and M_0 - 1), and the length of every section (each is a real number between and ).
For every test case, print the optimal average travel time with four decimal digits.
Example 1