Geometrija
시간 제한: 1000ms메모리 제한: 512MB출처: COCI 2020-2021BOJ 21224
문제
You are given n points on the plane, such that no three points lie on the same line.
We say that line segments AB and CD cross if they share a point X different from the points A, B, C and D.
Let S be the set of all line segments between pairs of the given points. Find the number of segments in S that don’t cross with any other segment in S.
입력
The first line contains an integer n (3 ≤ n ≤ 1000), the number of points.
The following n lines contain integers xi and yi (−109 ≤ xi, yi ≤ 109), the coordinates of the points.
출력
Output the requested number of segments.
예제
예제 1
입력
4 1 1 -1 1 -1 -1 1 -1
출력
4
예제 2
입력
4 -1 -1 1 -1 0 1 0 0
출력
6
코드를 제출하려면 로그인하세요.