The Mummy Returns

Tags:   注意是射线
Time Limit:  2 s      Memory Limit:   64 MB
Submission:104     AC:9     Score:99.39


The mummy returns! Imhotep has caught O’Connell’s little child to the Oasis of Ahm Shere to resurrect the Scorpion King. To rescue their son, O’Connell and Evelyn follow him, as well as our famous playboy, Jonathan. The Scorpion King gobbles up the power of Imhotep and becomes more powerful. The only way to kill him is to stab him with the Sword of Holy, which is in the hand of our playboy. This was simple because Jonathan was good at playing dart. But things turn bad when Imhotep is between Jonathan and the Scorpion King. If the sword stabs Imhotep before the Scorpion King, Imhotep will get back his power and become unbeatable! The two heroes, O’Connell and Evelyn, are fighting to make the two devil unmoved, and the playboy, Jonathan, is trying to kill the Scorpion King without hurting Imhotep. Will he make it?

To simplify the problem, we assume that the two devils are two untouched circles, the sword is a point outside the circles, and its flying path is a straight ray. Giving the description of the two circles and the point, can you tell if there is a ray from the point which can intersect the circle of the Scorpion King without intersect the circle of Imhotep? Here two items intersect means they share at least one common point.


The input file consists of multiple test cases.

The only one line of each test case consists following parameters: Xs, Ys, Xi, Yi, Ri, Xk, Yk, Rk.

(Xs, Ys) is the location of the Sword of Holy.

(Xi, Yi) is the location of Imhotep, and Ri is its radius.

(Xk, Yk) is the location of the Scorpion King, and Rk is its radius.

Your program should process to the end of the input file.


For each test case, output one line consisting of one English word “Yes” if Jonathon can kill the Scorpion King without hurt Imhotep, or “No” if not.


0 0 0 1 0.5 0 3 0.5 0 0 0 1 0.5 1 0 0.5
No Yes


The two circles will never intersect or cover each other, and the point is always outside the two circles.


3rd Central South China Programming Contest