Minho and Kangho

Two people walk straight lines at constant speeds over the same time span, and the program prints the smallest distance between them to ten decimal places.

Easy3GeometryMathInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

Minho and Kangho are on a two dimensional coordinate plane. Minho walks from point A(Ax,Ay)A(A_x, A_y) toward point B(Bx,By)B(B_x, B_y), and Kangho walks from point C(Cx,Cy)C(C_x, C_y) toward point D(Dx,Dy)D(D_x, D_y). They start at the same moment, and Kangho reaches DD at the same instant Minho reaches BB. Each of them walks at a constant speed.

Write a program that finds the smallest distance between Minho and Kangho during the walk.

The distance between two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is (x2x1)2+(y2y1)2\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.

Input

The first line contains AxA_x, AyA_y, BxB_x, ByB_y, CxC_x, CyC_y, DxD_x, DyD_y, separated by spaces. Every coordinate is an integer between 0 and 10000, inclusive.

AA and BB may be the same point, and CC and DD may be the same point. A walker whose two points are the same stands still.

Output

Print, on one line, the smallest distance between Minho and Kangho, rounded to the tenth digit after the decimal point. Pad with zeros so that exactly ten digits follow the decimal point.