Logo
(追記) (追記ここまで)

19193번 - Lines 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB4000.000%

문제

You are given $n$ 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 = 0$.

입력

The first line of input contains one positive integer $T,ドル the number of test cases. The test cases follow.

Each test case starts with a line containing an integer $n,ドル the number of lines (1ドル \le n \le 3000$). Each of the next $n$ lines of input contain three integers $A,ドル $B$ and $C$ describing a line as a set of points $(x, y)$ for which the equation $A x + B y + C = 0$ holds ($-10^9 \le A, B, C \le 10^9,ドル $A^2 + B^2 > 0$).

The sum of $n$ in the input does not exceed 3000ドル$.

출력

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

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

제한

예제 입력 1

2
2
1 1 0
1 1 1
2
-1 1 1
-2 1 1

예제 출력 1

1
1
1
1

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2015 > Day 7: Karelia Cup Day 1, Grand Prix of Karelia D번

Contest > Open Cup > 2014/2015 Season > Stage 8: Grand Prix of Karelia D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /