Two Circles

All submissions for this problem are available.
### Read problems statements in [Hindi](http://www.codechef.com/download/translated/COOK109/hindi/CIRCLES2.pdf), [Mandarin Chinese](http://www.codechef.com/download/translated/COOK109/mandarin/CIRCLES2.pdf), [Russian](http://www.codechef.com/download/translated/COOK109/russian/CIRCLES2.pdf), [Vietnamese](http://www.codechef.com/download/translated/COOK109/vietnamese/CIRCLES2.pdf), and [Bengali](http://www.codechef.com/download/translated/COOK109/bengali/CIRCLES2.pdf) as well. There are two circles in a plane. The radius of the first circle is $R_1$, while the radius of the second circle is $R_2$. The coordinates of the centre of the first circle are $(X_1, Y_1)$, while the coordinates the centre of the second circle are $(X_2, Y_2)$. Consider all points $P$ with the following properties:  $P$ lies strictly inside the first circle or on its perimeter.  $P$ lies strictly outside the second circle. Determine whether at least one point with these properties exists. If it exists, find one such point. ### Input  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  The first and only line of each test case contains six spaceseparated integers $X_1$, $Y_1$, $R_1$, $X_2$, $Y_2$ and $R_2$. ### Output For each test case, print a line containing the string `"YES"` if there is a point $P = (X, Y)$ with the given properties or `"NO"` otherwise. If there is such a point, print a second line containing two spaceseparated real numbers $X$ and $Y$. The coordinates $X$ and $Y$ will be considered correct if the distance of the point $(X, Y)$ from the centre of the first circle is at most $R_1 + 10^{6}$ and its distance from the centre of the second circle is at least $R_2  10^{6}$. Note that these conditions are not used to check the existence of the answer, their only purpose is to check the correctness of the coordinates $X$ and $Y$ with floating point precision. ### Constraints  $1 \le T \le 100,000$  $X_1, Y_1, X_2, Y_2 \le 10^6$  $1 \le R_1, R_2 \le 10^6$ ### Example Input ``` 3 0 0 2 0 0 3 5 5 1 0 0 1 0 1 1 0 2 2 ``` ### Example Output ``` NO YES 5.0000000 5.0000000 NO ```Author:  kingofnumbers 
Editorial  https://discuss.codechef.com/problems/CIRCLES2 
Tags  cook109, easy, geometry, kingofnumbers, taran_1407, trigonometry 
Date Added:  17082019 
Time Limit:  2 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 