Ardenia
Welcome to Ardenia. Ardenia is a mythical land, filled with adventure and danger, dwarves and dragons, mages and rouges. And puzzles. Lots of puzzles. Actually, the love for puzzles is the most important life ingredient of the inhabitants, and the only part they have in common.
This month, the people of Ardenia wonder what is the distance between two line segments in three dimensional space. The distance between segments is defined as the minimum among distances between two points of dierent segments. Actually, this problem had originally some motivation, but as nobody from Ardenia cares about motivations, neither should you.
Input
The first line contains the number of test cases t ≤ 10^5
.
The first line of each test case contains six integers x[1]
, y[1]
, z[1]
, x[2]
, y[2]
, z[2]
∈ [-20; 20]. Points (x[1]
, y[1]
, z[1]
) and (x[2]
, y[2]
, z[2]
) are the different endpoints of the first segment. The second line contains six integers in the same format, describing the second segment.
Output
Print two co-prime integers l and m > 0, such that l / m is the squared distance between the given two segments.