Circle and line
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
There is a circle of radius R with center at (x, y) and the line that is given with the coordinates of its two points. Find the length of the line segment inside the circle.
Input
One line contains radius of the circle R, the coordinates (x, y) of the circle center and coordinates of two points on the line. All numbers are integers, not greater than 10000 by absolute value.
Output
Print the length of the line segment inside the circle with 5 digits after the decimal point. If the circle and the line do not intersect, print -1, if touches - print 0.
Examples
Input #1
Answer #1
Submissions 4K
Acceptance rate 22%