Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

A tangent to a circle is a line in the plane of a circle which intersects the circle in exactly one point. Two circles can have one or more than one common tangent(s).

A tangent of two circles is called a common internal tangent if the intersection of the tangent and the line segment joining the centers is not empty. For example AB and CD are common internal tangents in the picture.

A tangent of two circles is a common external tangent if the intersection of the tangent and the line segment joining the centers is empty. For example, EF and GF are common external tangents.

You are given two circles. Co-ordinates of center of one circle is (**C _{x1}, C_{y1}**) and its radius is

If the circles have more than one common internal tangents, then you have to find the intersecting point of those tangents.

In the first line of input, an integer **T** is given, the number of test cases.
In each of the following lines, a test case is described with 6 integers: **C _{x1}, C_{y1}**,

**1 ≤ T ≤ 100000****0 ≤ C**_{x1}, C_{y1}, C_{x2}, C_{y2}≤ 100**1 ≤ R**_{1}, R_{2}≤ 100

Print the co-ordinates (**P _{x}, P_{y}**) of the intersecting point of the common internal tangents.

For each test case, print the numbers **P _{x}** and

If a number is **0**, then print only **0**, no need for **a/b** format. If the point does not exist, just print **NOT POSSIBLE** in that line.

Print the answer for each test case in a separate single line. See sample I/O for example.

Input | Output |
---|---|

1 3 6 2 20 3 4 | 26/3 5/1 |

85% Solution Ratio

Mansura_170300Earliest,

rezaulhsagarFastest, 0.0s

fsshakkhorLightest, 1.4 MB

sarthakmannaShortest, 477B

Login to submit