题库练习 [COCI-2020-2021-contest6]#4 Geometrija
← 上一题 下一题 →

A1397 | [COCI-2020-2021-contest6]#4 Geometrija

来源COCI
时间限制1s
内存限制128MB
通过 / 提交0/0

题目描述

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 (−10^9 ≤ xi, yi ≤ 10^9), the coordinates of the points.

输出格式

Output the requested number of segments.

输入输出样例

输入 #1
4
1 1
-1 1
-1 -1
1 -1
输出 #1
4
C++ 编辑器
输入
输出