Lines
시간 제한1초메모리 제한256 MB
중복, 평행, 그리고 y축 위에서의 교차를 모두 피하면서 최대로 많이 고를 수 있는 직선의 부분집합을 구한다.
문제
You are given 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 .
입력
The first line of input contains one positive integer , the number of test cases. The test cases follow.
Each test case starts with a line containing an integer , the number of lines (). Each of the next lines of input contain three integers , and describing a line as a set of points for which the equation holds (, ).
The sum of in the input does not exceed .
출력
For each test case, first, on a separate line, print the number : the maximum possible number of lines that can be selected. On the next line, print integers: the numbers of the chosen lines in any order. The lines are numbered starting from in the order they are given in the input.
If there are several optimal answers, print any one of them.