Limits 1s, 512 MB

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 (Cx1C_{x1}, Cy1C_{y1}) and its radius is R1R_1. Co-ordinates of center of the other circle is (Cx2C_{x2}, Cy2C_{y2}) and its radius is R2R_2.

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

Input

In the first line of input, an integer TT is given, the number of test cases. In each of the following lines, a test case is described with 6 integers: Cx1C_{x1}, Cy1C_{y1}, R1R_1, Cx2C_{x2}, Cy2C_{y2} and R2R_2.

  • 1T1000001 ≤ T ≤ 100000
  • 0Cx10 ≤ C_{x1}, Cy1C_{y1}, Cx2C_{x2}, Cy2100C_{y2} ≤ 100
  • 1R11 ≤ R_1, R2100R_2 ≤ 100

Output

Print the co-ordinates (PxP_x, PyP_y) of the intersecting point of the common internal tangents.

For each test case, print the numbers PxP_x and PyP_y separated by a space in a single line. Print each number in a/ba/b format, where aa and bb are co-prime i.e. gcd(a,b)=1gcd(a, b) = 1.

If aa number is 0, then print only 0, no need for a/ba/b format. If the point does not exist, just print NOT POSSIBLE\texttt{NOT POSSIBLE} in that line.

Print the answer for each test case in a separate single line.

Sample

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

Submit

Login to submit.

Statistics

88% Solution Ratio
Mansura_170300Earliest, Aug '19
nusuBotFastest, 0.0s
fsshakkhorLightest, 1.4 MB
sarthakmannaShortest, 477B
Toph uses cookies. By continuing you agree to our Cookie Policy.