The distance from the point to the segment
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Find the distance from a given point to a specified interval.
Input
Six numbers - the coordinates of the point and the coordinates of the endpoints. All input data are integers not exceeding modulo 10000.
Output
One number - the distance from the point to the segment with an accuracy of less than 10^{-5}.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 24%