A segment and a point lie in three dimensional space. The endpoints of the segment are A(Ax,Ay,Az) and B(Bx,By,Bz), and the point is C(Cx,Cy,Cz).
Write a program that finds the point of the segment closest to C and reports that distance. This value is the minimum distance between the segment and the point.
The distance between (x1,y1,z1) and (x2,y2,z2) is (x2−x1)2+(y2−y1)2+(z2−z1)2.
A and B may be the same point. The segment is then a single point.
Input
The first line contains nine integers Ax, Ay, Az, Bx, By, Bz, Cx, Cy, Cz separated by spaces. Every coordinate is an integer between 0 and 10000, inclusive.
Output
On the first line, print the minimum distance between the segment and the point, rounded to ten digits after the decimal point. Print exactly ten digits after the decimal point whatever the value is. For example, an answer of zero is printed as 0.0000000000.