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

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

Lines

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

요약
중복, 평행, 그리고 y축 위에서의 교차를 모두 피하면서 최대로 많이 고를 수 있는 직선의 부분집합을 구한다.
난이도

보통10점 중 6점

유형
기하, 조합론, 수학
정답자
아직 제출이 없습니다

문제

You are given nn lines on a plane. Your task is to select the maximum possible number of lines so that among the selected ones, no two lines are the same, no two lines are parallel and no two lines have an intersection at a point with x=0x = 0.

입력

The first line of input contains one positive integer TT, the number of test cases. The test cases follow.

Each test case starts with a line containing an integer nn, the number of lines (1≤n≤30001 \le n \le 3000). Each of the next nn lines of input contain three integers AA, BB and CC describing a line as a set of points (x,y)(x, y) for which the equation Ax+By+C=0A x + B y + C = 0 holds (−109≤A,B,C≤109-10^9 \le A, B, C \le 10^9, A2+B2>0A^2 + B^2 > 0).

The sum of nn in the input does not exceed 30003000.

출력

For each test case, first, on a separate line, print the number kk: the maximum possible number of lines that can be selected. On the next line, print kk integers: the numbers of the chosen lines in any order. The lines are numbered starting from 11 in the order they are given in the input.

If there are several optimal answers, print any one of them.

예제1

  1. 예제 1

    입력
    2
    2
    1 1 0
    1 1 1
    2
    -1 1 1
    -2 1 1
    
    예상 출력
    1
    1
    1
    1