T-X vs T-850
InterviewTime limit2sMemory limit1024 MB
For each query, decide whether the segment between two points avoids the boundary of a circle, so the shooter can see the target.
Problem
Time limit: 2000 ms. Memory limit: 1024 MB.
I'm back!
T-850
The T-850 terminator has returned to face the Skynet computer network again. This time Skynet sends its newest invention against it, the terminator T-X, built to destroy T-850 and start Judgment Day.
The fight takes place in open terrain with only one building. The building is a circle of radius centered at . T-850 is at and T-X is at . T-850 wants to fire at T-X, but it can do so only if it can see T-X.
T-850 sees T-X only if the segment connecting them does not intersect the wall of the building. Help the programmers from the future who write T-850's software handle even this case and determine whether T-850 can fire at T-X at this moment.
Input
The first line contains the number of queries (). Each query consists of three lines.
The first line gives the building's coordinates and radius , , . The second line gives the coordinates of T-850, , . The third line gives the coordinates of T-X, , .
All numbers in the input are integers with absolute value at most 100. It is guaranteed that the distance from the line through and to differs from by more than . It is also guaranteed that neither T-X nor T-850 lies on the boundary of the building.
Output
For each query, print YES if T-850 can fire at T-X, and NO otherwise.