The distance from a line segment to a circle#5154

The distance from a line segment to a circle

1 second
64 megabytes
Hard

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: x_0 y_0 .

The second line gives the coordinates of one endpoint of the line segment: x_1 y_1.

The third line provides the coordinates of the other endpoint: x_2 y_2.

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 decimal places.

Examples

Example 1

Loading
Loading