The distance from a line segment to a circle
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Determine the distance between a specified circle and a line segment.
Input
The first line of the input provides the coordinates of the circle's center and its radius. The second line gives the coordinates of one endpoint of the line segment, while the third line provides the coordinates of the other endpoint. The endpoints of the segment are distinct. All coordinates are integers, with absolute values not exceeding 10^4. The circle's radius is a positive integer.
Output
Output a single real number representing the distance from the line segment to the circle, accurate to at least 6 decimal places.
Examples
Input #1
Answer #1
Submissions 185
Acceptance rate 1%