The distance from the point to the segment#2138

The distance from the point to the segment

1 second
64 megabytes
Easy

Find the distance from a given point to a specified segment.

Input

Six numbers are given: the coordinates of the point and the coordinates of the endpoints of the segment. All input values are integers whose absolute value does not exceed .

Output

Output a single number — the distance from the point to the segment, with a precision of at least 10^{-5}.

Examples

Example 1

Loading
Loading