Construct Point
시간 제한2초메모리 제한256 MB
격자 삼각형 Q개에 대해 내부에 격자점이 있으면 그중 하나를 출력하고, 없으면 -1 -1을 출력한다.
문제
You have triangles, numbered through .
The coordinates of the vertices of the -th triangle are , and in counterclockwise order. Here, , , , , and 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:
출력
Output should contain lines.
In the -th line, if there is no grid point contained in the interior (excluding the boundary) of Triangle , print "-1 -1". If it exists, choose one such grid point, then print its -coordinate and -coordinate with a space in between.
제한
All input values are integers, , , , and are listed in counterclockwise order, the triangles are non-degenerate.