Rally

No attempts yetTime limit6sMemory limit128 MB

Problem

You are preparing for a car rally and must decide at which stations along the course to refuel.

The rules are:

  • Refueling at a station takes $T$ minutes ($1 \le T \le 10^4$).
  • The tank holds at most $F_{\max}$ liters ($10^3 \le F_{\max} \le 10^6$).
  • At the end of every kilometer driven, the fuel level $F$ instantly drops by $\Delta_F$ liters ($1 \le \Delta_F \le 50$).
  • The car's speed $S$, in kilometers per minute, rises as the fuel level falls, but with an empty tank the car does not move at all: $$S = \begin{cases} S_{\max} - C \cdot F & \text{if } F > 0 \ 0 & \text{if } F = 0 \end{cases}$$ where $10^3 \le S_{\max} \le 10^6$, $1 \le C \le 10^2$, and the data always keeps $S > 0$ while $F > 0$ (that is, $C \cdot F_{\max} < S_{\max}$). The fuel level is constant during a kilometer, so driving that kilometer takes $1/S$ minutes.
  • The rally is $D$ kilometers long ($10^3 \le D \le 10^6$).
  • There are $N$ fuel stations ($1 \le N \le 25$).
  • Station $i$ is $M_i$ kilometers from the start ($0 < M_i < D$, and $M_i < M_j$ whenever $i < j$).

The car begins at kilometer $0$ with a tank you fill for free and finishes at kilometer $D$. You may refuel at any subset of the stations, adding any amount of fuel that keeps the tank within its capacity; each refueling stop costs $T$ minutes. The total time is the driving time (the sum of $1/S$ over all $D$ kilometers) plus $T$ for every refueling stop you make.

Compute the minimum total time in which the rally can be completed.

Input

The input contains the following integers, each on its own line, in this order: $T$, $F_{\max}$, $\Delta_F$, $S_{\max}$, $C$, $D$, $N$, and then $M_1, M_2, \ldots, M_N$.

Output

Print one line: the minimum total time in minutes, rounded to exactly six digits after the decimal point.