아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Cut The Plane

시간 제한2초메모리 제한256 MB

요약
세 점이 한 직선 위에 있지 않은 n개의 점이 주어질 때, 주어진 점을 지나지 않으면서 모든 점을 서로 다른 영역으로 나누는 ceil(n/2)개의 직선을 출력한다.
난이도

보통10점 중 7점

유형
기하, 완전 탐색, 구현
정답자
아직 제출이 없습니다

문제

There are nn distinct points in the plane, any three of which are not colinear.

You are asked to use ⌈n2⌉\lceil \frac{n}{2} \rceil distinct lines passing through no given points to cut the plane into pieces such that no two points lie in the same piece.

입력

There are multiple test cases. The first line of the input contains an integer TT, indicating the number of test cases. For each test case:

The first line contains an integer nn (1≤n≤1001\le n\le 100) -- the number of points.

Each of the following nn lines contains two integers xx and yy (−1000≤x,y≤1000-1000\le x,y \le 1000) describing a point in the plane.

It is guaranteed that there always exists a solution for each test case and the sum of nn in all test cases does not exceed 10510^5.

출력

For each test case, output ⌈n2⌉\lceil \frac{n}{2} \rceil lines describing a solution.

Each line of them contains four integers x_1x\_1, y_1y\_1, x_2x\_2 and y_2y\_2 indicating a line through (x_1,y_1)(x\_1,y\_1) and (x_2,y_2)(x\_2,y\_2), where (x_1,y_1)≠(x_2,y_2)(x\_1,y\_1) \neq (x\_2,y\_2) and the absolute value of the coordinates should not exceed 10910^9.

예제1

  1. 예제 1

    입력
    2
    3
    0 0
    2 1
    4 0
    4
    0 1
    1 0
    2 1
    1 2
    
    예상 출력
    1 0 1 1
    3 0 3 1
    0 0 2 2
    2 0 0 2