403025: GYM100971 F Two Points
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
F. Two Pointstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
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.
InputThe 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.
OutputOutput a real number d — the minimal distance between the points. Absolute or relative error of the answer should be less than 10 - 6.
ExamplesInput1 1 2 2Output
0 0 -1 0
1.000000000000000Input
1 1 2 2Output
0 0 1 0
1.414213562373095