Codeforces Round 505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)
F
Disjoint Triangles
Codeforces
2700
原题
← EG →
翻译中…

A point belongs to a triangle if it lies inside the triangle or on one of its sides. Two triangles are disjoint if there is no point on the plane that belongs to both triangles.

翻译中…

You are given $n$ points on the plane. No two points coincide and no three points are collinear.

翻译中…

Find the number of different ways to choose two disjoint triangles with vertices in the given points. Two ways which differ only in order of triangles or in order of vertices inside triangles are considered equal.

翻译中…

Input

翻译中…

The first line of the input contains an integer $n$ ($6 \le n \le 2000$) – the number of points.

翻译中…

Each of the next $n$ lines contains two integers $x_i$ and $y_i$ ($|x_i|, |y_i| \le 10^9$) – the coordinates of a point.

翻译中…

No two points coincide and no three points are collinear.

翻译中…

Output

翻译中…

Print one integer – the number of ways to choose two disjoint triangles.

翻译中…

Note

翻译中…

In the first example there are six pairs of disjoint triangles, they are shown on the picture below.

翻译中…

image

翻译中…

All other pairs of triangles are not disjoint, for example the following pair:

翻译中…

image

翻译中…

样例

Input #1
6
1 1
2 2
4 6
4 5
7 2
5 3
Output #1
6
InputCopy OutputCopy
Input #2
7
0 -1000000000
-5 -5
5 -5
-5 0
5 0
-2 2
2 2
Output #2
21
InputCopy OutputCopy
题目信息
题号
1025F
时间限制
2 s
内存限制
256 MB
标签
计算几何

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。