eolymp
bolt
Try our new interface for solving problems
Problems

Tangent to the sphere

Tangent to the sphere

Time limit 2 seconds
Memory limit 256 MiB

Three spheres are given in a space. Find all their common tangent planes.

Input data

The number of the tests M is given in the first row. The following 3M lines describe the spheres themselves. Each sphere is described by four numbers: the coordinates of the center and the radius. All input numbers are integers; their coordinates range from -500 to +500, the radius is greater than zero and does not exceed 500. The sphere centers do not coincide and lie on a straight line.

Output data

For each test case print the number of different tangent planes K. The following K lines must describe these planes. Each line should contain four integers A, B, C, D, describing the plane Ax + By + Cz = D, such that A^2 + B^2 + C^2 = 1. The planes descriptions may be printed in any order. The numbers must be printed with the accuracy no less than 5 digits after the decimal point.

Examples

Input example #1
1
0 0 0 1
0 2 0 1
2 0 0 1
Output example #1
4
0.0000000000000000 1.0000000000000000 0.0000000000000000 1.0000000000000
1.0000000000000000 0.0000000000000000 0.0000000000000000 1.0000000000000
0.0000000000000000 0.0000000000000000 1.0000000000000000 -1.0000000000000
0.0000000000000000 0.0000000000000000 1.0000000000000000 1.0000000000000
Author Stanislav Pak
Source Winter School, Kharkov, 2011, Day 1