#P8000. [WFOI - 01] 循环节(circle)

    ID: 9082 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>计算几何洛谷原创Special JudgeO2优化凸包旋转卡壳洛谷月赛

[WFOI - 01] 循环节(circle)

Background

Simplified statement: Link\texttt{Link}

Setter’s note: これは非常に嫌な質問なので、あまり時間をかけたくない場合は、この質問を見る前に他の質問を終えることをお勧めします。

Problem Description

You are given a set of points aa on the coordinate plane. You need to find a subset of points bb and a vector xx such that $\exist\ z\in N^+,\{b\cup b+x\cup b+2x\cup\dots\cup b+zx=a\}$.

Now you are asked to find any triple b0,x0,z0b_0,x_0,z_0, where z0z_0 is the maximum zz among all triples satisfying the condition, any three points in b0b_0 are not collinear, any four points do not form a trapezoid or a parallelogram, and $b_0\cap b_0+x_0=\varnothing,b_0\cap b_0+2x_0=\varnothing,\dots,b_0\cap b+yx_0=\varnothing|{y\to+\infty}$.

Here, b+xb+x means the set of points obtained by translating every point in bb by the vector xx.

Input Format

The first line contains a positive integer nn.

The next nn lines each contain 22 integers, representing a point.

Output Format

Output a total of 44 lines:

The first line contains an integer b|b|.

The second line contains b|b| integers b1,b2,,bbb_1,b_2,\dots,b_{|b|} (corresponding indices).

The third line contains two integers xx.

The fourth line contains an integer zz.

4
0 0
0 1
1 0
1 1
2
1 3
0 1
1
3
0 0
0 1
1 0
3
1 2 3
0 0
0

Hint

Since the sample explanation would only repeat the statement, and it is believed that if you have reached this problem you should be able to understand its meaning, no sample explanation is provided (actually the setter is lazy).

This problem uses bundled Subtask tests.

Subtask ID Constraints and Notes
Subtask #0(20 pts\text{20 pts}) 1n101\le n\le10; 10xi,yi10-10\le x_i,y_i \le 10
Subtask #1(20 pts\text{20 pts}) 1n1031\le n\le10^3
Subtask #2(30 pts\text{30 pts}) z>1z>1
Subtask #3(30 pts\text{30 pts}) No special restrictions.

For 100%100\% of the testdata, 1n1051\le n\le10^5, the coordinate range of points is (109,109)\in\left(-10^9,10^9\right), and the testdata guarantees that a solution exists.

Translated by ChatGPT 5