QOJ.ac

QOJ

Time Limit: 10 s Memory Limit: 2048 MB Total points: 100

#5725. 枢轴点

Statistics

考虑平面上的一组点集 $P$,其中任意三点不共线。我们按如下方式构造一个“风车”:

选择 $P$ 中的一点 $p$ 和一个起始方向,使得过 $p$ 点且沿该方向的直线不与 $P$ 中的其他任何点相交。画出这条直线。

像风车一样,以 $p$ 点为轴心,缓慢地顺时针旋转该直线,直到直线与 $P$ 中的另一点 $p'$ 相交。将该点 $p'$ 指定为新的轴心(称此过程为“提升”点 $p'$),然后继续旋转。

重复此过程,直到直线旋转了完整的 360 度,回到其初始方向(可以证明,直线在旋转 360 度后也会回到其初始位置)。

在此过程中,同一个点可能会被多次提升。考虑所有可能的起始轴心和方向,求在直线旋转 360 度的过程中,单个点被提升的最大次数。

输入格式

输入的第一行包含一个整数 $n$,其中 $2 \le n \le 2000$。接下来的 $n$ 行,每行包含两个整数 $x_i$ 和 $y_i$,满足 $-10\,000 \le x_i, y_i \le 10\,000$。

输出格式

输出一行,包含一个整数,表示在上述任意起始直线进行完整旋转的过程中,任何特定点作为轴心的最大次数。

样例

样例输入 1

3
-1 0
1 0
0 2

样例输出 1

2

样例输入 2

6
0 0
5 0
0 5
5 5
1 2
4 2

样例输出 2

3

Figure 1. 风车示意图

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.