eolymp
bolt
Try our new interface for solving problems
Problems

The distance between the segments

The distance between the segments

Time limit 1 second
Memory limit 64 MiB

Find distance between two segments.

Input data

Eight of integers - the coordinates of the four ends of two segments. All input data are integers not exceeding modulo 10000.

Output data

One number - the distance between the segments with an accuracy of less than 10^{-6}.

Examples

Input example #1
1 1 2 2 2 1 3 0
Output example #1
0.70710678118654752