Make Many Triangles

AtCoder
IDarc173_b
Time2000ms
Memory256MB
Difficulty
There are $N$ distinct points on a two-dimensional plane. The coordinates of the $i$\-th point are $(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 * $3 \leq N \leq 300$ * $-10^9 \leq x_i,y_i \leq 10^9$ * If $i \neq j$, then $(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: $N$ $x_1$ $y_1$ $x_2$ $y_2$ $\vdots$ $x_{N}$ $y_{N}$ [samples]
Samples
Input #1
7
0 0
1 1
0 3
5 2
3 4
2 0
2 2
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.
Input #2
3
0 0
0 1000000000
0 -1000000000
Output #2
0
API Response (JSON)
{
  "problem": {
    "name": "Make Many Triangles",
    "description": {
      "content": "There are $N$ distinct points on a two-dimensional plane. The coordinates of the $i$\\-th point are $(x_i,y_i)$. We want to create as many (non-degenerate) triangles as possible using these points as t",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc173_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are $N$ distinct points on a two-dimensional plane. The coordinates of the $i$\\-th point are $(x_i,y_i)$.\nWe want to create as many (non-degenerate) triangles as possible using these points as t...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments