아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Geometrija

시간 제한1초메모리 제한512 MB

요약
일반 위치에 있는 n개의 점이 주어질 때, 다른 선분과 교차하지 않는 두 점 사이 선분의 개수를 구한다.
난이도

보통10점 중 4점

유형
기하
정답자
아직 제출이 없습니다

문제

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.

예제2

  1. 예제 1

    입력
    4
    1 1
    -1 1
    -1 -1
    1 -1
    
    예상 출력
    4
    
  2. 예제 2

    입력
    4
    -1 -1
    1 -1
    0 1
    0 0
    
    예상 출력
    6