408359: GYM103104 J Similar Triangles

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Similar Trianglestime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are playing a game on a grid.

Given is a triangle with integer vertex coordinates. You task is to find out a triangle with integer vertex coordinates, similar with the given triangle and it has the smallest area.

Input

The first line contains a single integer $$$T$$$ ($$$1\le T\le 10^4$$$) — the number of test cases. Then $$$T$$$ test cases follow.

Each test case has one line, contains six integers $$$x_A,y_A,x_B,y_B,x_C,y_C$$$ — the coordinates of three vertexes (A,B,C) on the triangle.

it's guaranteed that $$$-10^9 \le x_A,y_A,x_B,y_B,x_C,y_C \le 10^9$$$, and three vertexes A,B,C would not in same Line.

Output

For each test case, print six integers: $$$x_A',y_A',x_B',y_B',x_C',y_C'$$$ — the coordinates of three vertexes on the triangle constructed by yourself.

It's noticed that $$$-10^9 \le x_A',y_A',x_B',y_B',x_C',y_C' \le 10^9$$$ should be satisfied.

ExampleInput
1
-1 -1 1 0 -2 1
Output
0 0 -1 0 -1 -1
Note

In the first test case, you can find out a triangle with integer vertex coordinates whose area is $$$\frac{1}{2}$$$

加入题单

上一题 下一题 算法标签: