Jakob works as a Quality Assurance technician at a factory which creates custom-made coaxially-bundled cables for specialty uses. To construct a cable bundle, an assembly worker performes the following steps:
D.N rods of equal diameters d and bundles them around core.T.Here are some cross-sections of completed cable bundles:
A cross-section of a completed coaxial cable bundle:
a copper core in Yellow (with diameter D),
7 rods in Red (each with diameter d),
a tube sleeve in Blue (with total diameter T).
Notice how every rod touches the core, the tube wall, and both adjacent rods.
The values of D, N, and d must be chosen carefully to ensure that this happens,
or else the bundle will not work properly. Here are some
more examples of valid bundles:
More valid cable bundles.
And here is an example of an invalid bundle:
An invalid cable bundle. Notice the gap between two of the red rods.
Also note the yellow core and the blue tube both share the same centerpoint, shown in the above pictures in Black. As these are three-dimensional objects, the black dot represents the centerline axis shared by the core and the tube, and that is why they are called coaxial cable bundles.
Recently the factory where Jakob works has purchased an automatic packaging and labeling
machine. An assembly worker places a completed cable bundle into the machine and types in
the parameters T D N d. The machine then affixes plugs to each end of the cable, coils
the cable, places the cable into a box, and then labels the box with the information T D N d
so that the buyer can know the type of cable is inside.
At the end of the day Jakob inspects each box before shipping them out to be sold, but one
day Jakob notices that the label machine must have become misaligned, as several boxes are
only labeled with the values T D and are completely missing the values N d. Relabeling
each box wouldn't take a large amount of time, but Jakob then realizes that he would be unable
to open the cable to count and measure the rods without destroying the cable tubing and thus
rendering the expensive cable defective.
Given T and D, calculate both N and d so that the boxes can be re-labeled without
destroying the cables.
Input Data
First line will be Q, the quantity of testcases.
Q lines will then follow, each with two space-separated values in the format T D.
Answer
Should consist of Q pairs of values in the format N d corresponding corresponding to the
quantity and diameters of the rods around the copper core in each testcase.
N will always be an exact integer.
Error in d should be less than 1e-3.
Example
inpug data:
2
3 1
5.511 3.8
answer:
6 1 17 0.855