P2571 [SCOI2010] Conveyor Belt

Description

In a $2$-dimensional plane, there are two conveyor belts, each of which can be regarded as a line segment. The two conveyor belts are line segment $\text{AB}$ and line segment $\text{CD}$. lxhgww moves at speed $P$ on $\text{AB}$, at speed $Q$ on $\text{CD}$, and at speed $R$ on the plane. Now lxhgww wants to go from point $\text{A}$ to point $\text{D}$, and he wants to know the minimum time required.

Input Format

The first line contains $4$ integers, giving the coordinates of $\text{A}$ and $\text{B}$, namely $A_x$, $A_y$, $B_x$, $B_y$. The second line contains $4$ integers, giving the coordinates of $\text{C}$ and $\text{D}$, namely $C_x$, $C_y$, $D_x$, $D_y$. The third line contains $3$ integers, which are $P$, $Q$, and $R$.

Output Format

Output one line, the minimum time for lxhgww to go from point $\text{A}$ to point $\text{D}$, rounded to $2$ decimal places.

Explanation/Hint

For $100\%$ of the testdata, $1 \le A_x, A_y, B_x, B_y, C_x, C_y, D_x, D_y \le 10^3$, $1 \le P, Q, R \le 10$. Translated by ChatGPT 5