| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 17 | 9 | 8 | 50.000% |
There are $N$ power sources, numbered from $1$ to $N$, scattered around the ICPC Kingdom. Power source $i$ is uniquely located at coordinate $(X_i , Y_i)$ 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 $i$ and $j$ that satisfies $1 ≤ i < j ≤ N$, a magical barrier forms as a line segment that spans from $(X_i , Y_i)$ to $(X_j , Y_j )$.
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 $b$ as the number of magical barriers other than $b$ that intersects with $b$. Two distinct magical barriers are intersecting if and only if there exists exactly one point $(x, y)$ that lies on both magical barriers while none of the $N$ power sources are located at $(x, y)$.
You want to find the strength of the strongest magical barrier in the ICPC Kingdom.
Input begins with an integer $N$ ($2 ≤ N ≤ 1000$) representing the number of power sources. Each of the next $N$ lines contains $2$ integers $X_i$ $Y_i$ ($-10^9 ≤ X_i , Y_i ≤ 10^9$) representing the location of power source $i$. 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
Let $〈i, j〉$ be the magical barrier that spans from power source $i$ to power source $j$.
One of the strongest magical barriers is $〈1, 4〉$ with a strength of $3$. The $3$ magical barriers that intersect with $〈1, 4〉$ are $〈2, 3〉$, $〈3, 6〉$, and $〈3, 5〉$. Note that the magical barrier $〈2, 3〉$ also has a strength of $3$.
2 0 0 0 1
0
The only magical barrier is $〈1, 2〉$ with a strength of $0$.
4 -3 0 3 0 0 3 0 1
0
All magical barriers have a strength of $0$.
4 0 0 0 1 1 0 1 1
1
The strongest magical barrier is either $〈1, 4〉$ or $〈2, 3〉$, which intersects each other at $(0.5, 0.5)$.