4487: E. Draw a triangle
内存限制:512 MB
时间限制:1 S
标准输入输出
题目类型:传统
评测方式:Special Judge
上传者:
提交:8
通过:0
题目描述
Little Desprado2 is a student of Springfield Flowers Kindergarten. On this day, he had just learned how to draw triangles on grid coordinate paper. However, he soon found it very dull, so he came up with a more interesting question:
He had drawn two integral points of the triangle on the grid paper, and he denotes them (x1,y1) and (x2,y2). Now, he wanted to know the answer to the following question: where can he draw the third point (x3,y3) so that the area of the triangle is positive but minimized?
Obviously, he can't solve this problem because he is too young and simple. Can you tell him the answer?
Please note that your answer's coordinates must consist of integers because he is drawing on grid paper, and the triangle shouldn't be a degenerated triangle to keep the area positive.
He had drawn two integral points of the triangle on the grid paper, and he denotes them (x1,y1) and (x2,y2). Now, he wanted to know the answer to the following question: where can he draw the third point (x3,y3) so that the area of the triangle is positive but minimized?
Obviously, he can't solve this problem because he is too young and simple. Can you tell him the answer?
Please note that your answer's coordinates must consist of integers because he is drawing on grid paper, and the triangle shouldn't be a degenerated triangle to keep the area positive.
输入格式
The first line contains one integer T (1≤ T≤ 50,000), denoting the number of Little Desprado2's queries.
For each test case, there's a single line contains four integers x1, y1, x2, y2 (-109 ≤ x1, y1, x2, y2 ≤ 109) seperated by spaces, denoting two points are at (x1,y1) and (x2,y2), respectively.
It is guaranteed that the two points won't coincide.
For each test case, there's a single line contains four integers x1, y1, x2, y2 (-109 ≤ x1, y1, x2, y2 ≤ 109) seperated by spaces, denoting two points are at (x1,y1) and (x2,y2), respectively.
It is guaranteed that the two points won't coincide.
输出格式
For each test case, print two integers x3, y3 (-1018≤ x3, y3≤ 1018) in a separated line, denoting your answer.
If there are multiple answers, you can print any one of them. It is guaranteed that there exists a solution in the above range.
If there are multiple answers, you can print any one of them. It is guaranteed that there exists a solution in the above range.
输入样例 复制
3
1 0 1 4
0 1 0 9
0 0 2 2
输出样例 复制
2 0
1 1
-1 0