#arc173b. B - Make Many Triangles

B - Make Many Triangles

Score: 500500 points

问题陈述

在二维平面上有NN个不同的点。第ii个点的坐标是(xi,yi)(x_i,y_i)

我们想使用这些点作为顶点,尽可能多地创建(非退化的)三角形。这里,同一个点不能用作多个三角形的顶点。

找出可以创建的三角形的最大数量。

什么是非退化三角形?非退化三角形是指其三个顶点不共线的三角形。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

There are NN distinct points on a two-dimensional plane. The coordinates of the ii-th point are (xi,yi)(x_i,y_i).

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

  • 3N3003 \leq N \leq 300
  • 109xi,yi109-10^9 \leq x_i,y_i \leq 10^9
  • If iji \neq j, then (xi,yi)(xj,yj)(x_i,y_i) \neq (x_j,y_j)
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN

x1x_1 y1y_1

x2x_2 y2y_2

\vdots

xNx_{N} yNy_{N}

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