#arc173b. B - Make Many Triangles
B - Make Many Triangles
Score: points
问题陈述
在二维平面上有个不同的点。第个点的坐标是。
我们想使用这些点作为顶点,尽可能多地创建(非退化的)三角形。这里,同一个点不能用作多个三角形的顶点。
找出可以创建的三角形的最大数量。
什么是非退化三角形?非退化三角形是指其三个顶点不共线的三角形。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
There are distinct points on a two-dimensional plane. The coordinates of the -th point are .
We want to create as many (non-degenerate) triangles as possible using these points as the vertices. Here, the same point cannot be used as a vertex of multiple triangles.
Find the maximum number of triangles that can be created.
What is a non-degenerate triangle? A non-degenerate triangle is a triangle whose three vertices are not collinear.
Constraints
- If , then
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
7
0 0
1 1
0 3
5 2
3 4
2 0
2 2
Sample Output 1
2
For example, if we create a triangle from the first, third, and sixth points and another from the second, fourth, and fifth points, we can create two triangles.
The same point cannot be used as a vertex for multiple triangles, but the triangles may have overlapping areas.
Sample Input 2
3
0 0
0 1000000000
0 -1000000000
Sample Output 2
0