Circle and segment
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Find out how many points of intersection of the circle are given by the center coordinates (X, Y) and radius R, and the segment specified by the coordinates of its ends (X_1, Y_1), (X_2, Y_2).
Input
Seven integers X, Y, R, X_1, Y_1, X_2, Y_2, whose moduli do not exceed 1000.
Output
The number of intersection points.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 8%