#C9760. Minimum Straight-Line Rope Segments

    ID: 53889 Type: Default 1000ms 256MiB

Minimum Straight-Line Rope Segments

Minimum Straight-Line Rope Segments

You are given a rope with N knots on it. Each knot is located at a distinct coordinate in the 2D plane. Your task is to segment the rope such that in each segment all knots lie on a single straight line. Determine the minimum number of segments required.

More formally, given a list of points \( (x_i, y_i) \) representing the knots, you need to partition this set into the minimum number of groups such that, for each group, all points are collinear. Two or fewer points are always considered collinear.

Note: Two points \( (x_1, y_1) \) and \( (x_2, y_2) \) are collinear with a third point \( (x_3, y_3) \) if the area of the triangle formed by them is zero. In mathematical terms, points \( A, B, C \) are collinear if \[ (x_B - x_A)\,(y_C - y_A) - (y_B - y_A)\,(x_C - x_A) = 0. \]

inputFormat

The first line contains a single integer \( N \) (the number of knots). Each of the following \( N \) lines contains two space-separated integers, representing the coordinates \( x \) and \( y \) of a knot.

outputFormat

Output a single integer — the minimum number of segments needed to partition the rope so that every segment's knots are collinear.

## sample
6
0 0
1 1
2 2
2 3
4 4
10 10
2