{"raw_statement":[{"iden":"statement","content":"There are two points (x1, y1) and (x2, y2) on the plane. They move with the velocities (vx1, vy1) and (vx2, vy2). Find the minimal distance between them ever in future.\n\nThe first line contains four space-separated integers x1, y1, x2, y2 ( - 104 ≤ x1,  y1,  x2,  y2 ≤ 104) — the coordinates of the points.\n\nThe second line contains four space-separated integers vx1, vy1, vx2, vy2 ( - 104 ≤ vx1,  vy1,  vx2,  vy2 ≤ 104) — the velocities of the points.\n\nOutput a real number d — the minimal distance between the points. Absolute or relative error of the answer should be less than 10 - 6.\n\n"},{"iden":"input","content":"The first line contains four space-separated integers x1, y1, x2, y2 ( - 104 ≤ x1,  y1,  x2,  y2 ≤ 104) — the coordinates of the points.The second line contains four space-separated integers vx1, vy1, vx2, vy2 ( - 104 ≤ vx1,  vy1,  vx2,  vy2 ≤ 104) — the velocities of the points."},{"iden":"output","content":"Output a real number d — the minimal distance between the points. Absolute or relative error of the answer should be less than 10 - 6."},{"iden":"examples","content":"Input1 1 2 20 0 -1 0Output1.000000000000000Input1 1 2 20 0 1 0Output1.414213562373095"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ \\mathbf{p}_1 = (x_1, y_1), \\mathbf{p}_2 = (x_2, y_2) \\in \\mathbb{R}^2 $ be initial positions.  \nLet $ \\mathbf{v}_1 = (v_{x1}, v_{y1}), \\mathbf{v}_2 = (v_{x2}, v_{y2}) \\in \\mathbb{R}^2 $ be constant velocities.  \n\n**Constraints**  \n$ |x_1|, |y_1|, |x_2|, |y_2|, |v_{x1}|, |v_{y1}|, |v_{x2}|, |v_{y2}| \\leq 10^4 $\n\n**Objective**  \nDefine the relative position and velocity:  \n$ \\mathbf{r}(t) = (\\mathbf{p}_2 + t\\mathbf{v}_2) - (\\mathbf{p}_1 + t\\mathbf{v}_1) = \\mathbf{r}_0 + t\\mathbf{v}_r $,  \nwhere $ \\mathbf{r}_0 = (x_2 - x_1, y_2 - y_1) $, $ \\mathbf{v}_r = (v_{x2} - v_{x1}, v_{y2} - v_{y1}) $.  \n\nFind the minimal Euclidean distance:  \n$$\nd = \\min_{t \\geq 0} \\|\\mathbf{r}(t)\\| = \\min_{t \\geq 0} \\sqrt{ (\\mathbf{r}_0 + t\\mathbf{v}_r) \\cdot (\\mathbf{r}_0 + t\\mathbf{v}_r) }\n$$","simple_statement":"Two points move with constant velocities. Find the smallest distance between them at any future time.","has_page_source":false}