eolymp
bolt
Try our new interface for solving problems
Problems

Circle and segment

Circle and segment

Find out how many points of intersection of the circle are given by the center coordinates (\textbf{X}, \textbf{Y}) and radius \textbf{R}, and the segment specified by the coordinates of its ends (\textbf{X_1}, \textbf{Y_1}), (\textbf{X_2}, \textbf{Y_2}). \InputFile Seven integers \textbf{X}, \textbf{Y}, \textbf{R}, \textbf{X_1}, \textbf{Y_1}, \textbf{X_2}, \textbf{Y_2}, whose moduli do not exceed \textbf{1000}. \OutputFile The number of intersection points.
Time limit 1 second
Memory limit 64 MiB
Input example #1
0 0 5 1 1 6 6
Output example #1
1