Distance between rays#5136

Distance between rays

1 second
64 megabytes
Very hard

On a plane, there are two rays, each defined by a pair of points.

Your task is to calculate the distance between these two rays.

Input

The input consists of four pairs of integers, representing the descriptions of the first and second ray. Each ray is described by the coordinates of its starting point and another point on the ray.

Output

Output a single real number representing the required distance, with a precision of up to the -th decimal place.

Examples

Example 1

Loading
Loading