#P15617. [ICPC 2022 Jakarta R] Magical Barrier
[ICPC 2022 Jakarta R] Magical Barrier
题目描述
There are power sources, numbered from 1 to , scattered around the ICPC Kingdom. Power source is uniquely located at coordinate in a 2D Cartesian plane such that there are no three power sources located in a straight line.
For each pair of distinct power sources and that satisfies , a magical barrier forms as a line segment that spans from to .
You noticed a strange phenomenon. When two distinct magical barriers are intersecting, then both magical barriers are somewhat strengthened. To simplify things, you define the strength of a magical barrier as the number of magical barriers other than that intersects with . Two distinct magical barriers are intersecting if and only if there exists exactly one point that lies on both magical barriers while none of the power sources are located at .
You want to find the strength of the strongest magical barrier in the ICPC Kingdom.
输入格式
Input begins with an integer () representing the number of power sources. Each of the next lines contains 2 integers () representing the location of power source . It is guaranteed that the location of each power source is unique, and there are no three power sources located in a straight line.
输出格式
Output an integer in a single line representing the strength of the strongest magical barrier.
6
0 0
0 6
6 0
6 6
1 4
1 2
3
2
0 0
0 1
0
4
-3 0
3 0
0 3
0 1
0
4
0 0
0 1
1 0
1 1
1
提示
Explanation for the sample input/output #1
Let be the magical barrier that spans from power source to power source .
One of the strongest magical barriers is with a strength of . The magical barriers that intersect with are , , and . Note that the magical barrier also has a strength of .
Explanation for the sample input/output #2
The only magical barrier is with a strength of .
Explanation for the sample input/output #3
All magical barriers have a strength of .
Explanation for the sample input/output #4
The strongest magical barrier is either or , which intersects each other at .