Category
Similar Problems
0735. The circle and line
Time limit : 1000 ms
Memory limit : 64 mb
There is a circle of radius R with
center (x,y) and
the line which is given by the coordinates of its two points. What is the length of the line segment
lies inside the circle?
Input
The string with 7 numbers is given: the radius of the circle, the coordinates x, y of the center and 2points of the line. All numbers are integers, their absolute value does not exceed 10000. 2points don’t coincide.
Output
Print the desired length with 5 digits after the decimal point. If the circle and the line do not intersect, print -1, if touches - print 0.
Samples
№ |
Input |
Output |
1 |
5 0 0 4 1 4 2 |
6.00000 |
Text from: e-olimp.com