Windmill Pivot
题号:NC224737
时间限制:C/C++/Rust/Pascal 10秒,其他语言20秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Consider a set of points 𝑃 in the plane such that no 3 points are collinear. Construct a windmill as follows:
1. Choose a point 𝑝 ∈ 𝑃 and a starting direction such that the line through 𝑝 in that 
direction does not intersect any other points in 𝑃. Draw that line (Note:line, NOT ray).
2. Rotate the line clockwise like a windmill about the point 𝑝 as its pivot until the line 
intersects another point 𝑞 ∈ 𝑃. Designate that point 𝑞 to be the new pivot, and then
continue the rotation. This is called promoting point 𝑞.
3.  Continue this process until the line has rotated a full 360°, returning to its original 
direction (it can be shown that the line will also return to its original position after a
360° rotation)

During this process, a given point in 𝑃 can be a pivot multiple times. Considering all possible starting
pivots and orientations, find the maximum number of times that a single point can be promoted during a
single 360° rotation of a windmill. Note that the first point is a pivot, but not promoted to be a pivot at the start.

输入描述:

The first line of input contains a single integer 𝒏 (2 ≤ 𝒏 ≤ 2000), which is the number of points 𝑝 ∈ 𝑃.

Each of the next 𝒏 lines contains two space-separated integers 𝒙 and 𝒚 (−105 ≤ 𝒙, 𝒚 ≤ 105 ). These are
the points. Each point will be unique, and no three points will be collinear.

输出描述:

Output a single integer, which is the maximum number of times any point 𝑝 ∈ 𝑃 can be promoted,
considering a full 360° rotation and any arbitrary starting point.
示例1

输入

复制
3 
-1 0 
1 0 
0 2

输出

复制
2
示例2

输入

复制
6 
0 0 
5 0 
0 5 
5 5 
1 2 
4 2

输出

复制
3