import math
class Point:
def __init__(self, A, B):
self.x = A
self.y = B
class Line:
def __init__(self, A, B):
self.point_A = A
self.point_B = B
class Circle:
def __init__(self, A, B):
self.O = A
self.r = B
def getDistance(circle, l):
# 请在这里实现你的代码
pass
#先求直线L点斜式 k , C
#先求圆心到直线的距离
if l.point_A.x == l.point_B.x:
h = abs(circle.O.x - l.point_A.x )
else :
x_a,y_a, x_b , y_b = l.point_A.x, l.point_A.y , l.point_B.x , l.point_B.y
k = (y_b - y_a) / (x_b - x_a)
c = y_a - k * x_a
h = abs(k * circle.O.x - circle.O.y + c) / math.sqrt(k**2 +1)
#判断直线是否与圆相交,再求弦长
if h >= circle.r:
d = 0.0
else:
d =2 * math.sqrt(circle.r **2 - h ** 2)
return d
def main():
ox, oy, r = map(float, input().split())
x1, y1, x2, y2 = map(float, input().split())
center = Point(ox, oy)
circle = Circle(center, int(r))
p1 = Point(x1, y1)
p2 = Point(x2, y2)
l = Line(p1, p2)
result = getDistance(circle, l)
print("{:.6f}".format(result))
if __name__ == "__main__":
main()