시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
15 초 (추가 시간 없음) | 1024 MB | 0 | 0 | 0 | 0.000% |
You are given a set $P$ of $\mathbf{N}$ distinct points in the two-dimensional plane. You want to find a maximum set of triangles such that:
For example, the set of triangles depicted below meets the definition above.
On the other hand, each pair of a yellow and a red triangle in the picture below does not meet the definition.
The first line of the input gives the number of test cases, $\mathbf{T}$. $\mathbf{T}$ test cases follow. Each test case starts with a line containing a single integer $\mathbf{N}$. Then, $\mathbf{N}$ lines follow. The $i$-th of these lines contains two integers $\mathbf{X_i}$ and $\mathbf{Y_i}$ representing the coordinates of the $i$-th point.
For each test case, output one line containing Case #x: y
, where $x$ is the test case number (starting from 1) and $y$ is the maximum size of a set of triangles with the desired properties. Then, output $y$ more lines. The $j$-th of those lines must contain $p_j\ q_j\ r_j$ representing that the $j$-th triangle in your proposed set has the $p_j$-th, $q_j$-th, and $r_j$-th points in the input as vertices. Points in the input are numbered starting from $1$.
3 9 8 2 10 2 2 0 0 5 2 3 10 4 10 0 8 3 2 4 7 0 0 0 3 3 0 0 1 1 0 1 1 2 2 3 0 0 0 1 0 2
Case #1: 3 3 4 5 1 7 9 6 2 8 Case #2: 2 2 3 1 6 5 4 Case #3: 0
Sample Case #1 is illustrated below. Notice that there are other valid ways to construct a maximum number of triangles.
Sample Case #2 is illustrated below. As before, there are other valid ways to construct $2$ triangles.
In Sample Case #3, the $3$ given points are collinear, so it is not possible to make a valid triangle with them.
Contest > Google > Code Jam > Google Code Jam 2022 > World Finals E번