Construct Point

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

You have QQ triangles, numbered 11 through QQ.

The coordinates of the vertices of the ii-th triangle are (x_1_i,y_1_i)(x\_{1\_i}, y\_{1\_i}), (x_2_i,y_2_i)(x\_{2\_i}, y\_{2\_i}) and (x_3_i,y_3_i)(x\_{3\_i}, y\_{3\_i}) in counterclockwise order. Here, x_1_ix\_{1\_i}, x_2_ix\_{2\_i}, x_3_ix\_{3\_i}, y_1_iy\_{1\_i}, y_2_iy\_{2\_i} and y_3_iy\_{3\_i} are all integers.

For each triangle, determine if there exists a grid point contained in its interior (excluding the boundary). If it exists, construct one such point.

입력

Input is given in the following format:

QQ

x_1_1x\_{1\_1} y_1_1y\_{1\_1} x_2_1x\_{2\_1} y_2_1y\_{2\_1} x_3_1x\_{3\_1} y_3_1y\_{3\_1}

x_1_2x\_{1\_2} y_1_2y\_{1\_2} x_2_2x\_{2\_2} y_2_2y\_{2\_2} x_3_2x\_{3\_2} y_3_2y\_{3\_2}

\ldots

x_1_Qx\_{1\_Q} y_1_Qy\_{1\_Q} x_2_Qx\_{2\_Q} y_2_Qy\_{2\_Q} x_3_Qx\_{3\_Q} y_3_Qy\_{3\_Q}

출력

Output should contain QQ lines.

In the ii-th line, if there is no grid point contained in the interior (excluding the boundary) of Triangle ii, print "-1 -1". If it exists, choose one such grid point, then print its xx-coordinate and yy-coordinate with a space in between.

제한

All input values are integers, 1Q10,0001 \leq Q \leq 10\\,000, 0x_1_i,x_2_i,x_3_i,y_1_i,y_2_i,y_3_i1090 \leq x\_{1\_i}, x\_{2\_i}, x\_{3\_i}, y\_{1\_i}, y\_{2\_i}, y\_{3\_i} \leq 10^9, (x_1_i,y_1_i)(x\_{1\_i}, y\_{1\_i}), (x_2_i,y_2_i)(x\_{2\_i}, y\_{2\_i}) and (x_3_i,y_3_i)(x\_{3\_i}, y\_{3\_i}) are listed in counterclockwise order, the triangles are non-degenerate.