Parallel Lines

Given up to 16 distinct points, pair them up to maximize the number of parallel pairs among the drawn segments.

Hard8Bit manipulationDynamic programmingGeometryCombinatoricsNo attempts yetTime limit10sMemory limit512 MB

Problem

You are given an even number of distinct points on the plane. Couple all of the points into pairs so that every point is coupled with exactly one other point, and consider every such coupling.

Draw the segment that connects the two points of each couple. Some of the drawn segments are parallel to others. Find the maximum number of parallel segment pairs over all possible couplings.

For the four points (0,0)(0, 0), (1,1)(1, 1), (0,2)(0, 2) and (2,4)(2, 4) there are three couplings, shown in Figure B.1. The numbers of parallel segment pairs are 0, 0 and 1, from the left, so the maximum is 1.

Figure B.1. All three possible couplings of the four points

Eight points can be coupled as shown in Figure B.2. With that coupling all four segments are parallel to one another, so the six pairs (L1,L2)(L_1, L_2), (L1,L3)(L_1, L_3), (L1,L4)(L_1, L_4), (L2,L3)(L_2, L_3), (L2,L4)(L_2, L_4) and (L3,L4)(L_3, L_4) are parallel and the maximum is 6.

Figure B.2. A coupling of eight points that maximizes the number of parallel segment pairs

Input

The input consists of a single test case of the following format.

m
x1 y1
.
.
.
xm ym

The first line contains an even integer mm, the number of points (2m162 \le m \le 16). Each of the following mm lines gives the coordinates of one point. The integers xix_i and yiy_i in the ii-th of those lines are the x-coordinate and the y-coordinate of the ii-th point (1000xi1000-1000 \le x_i \le 1000, 1000yi1000-1000 \le y_i \le 1000).

All points are at different positions, that is, xixjx_i \ne x_j or yiyjy_i \ne y_j holds for all iji \ne j. No three points lie on a single line.

Output

Print the maximum number of parallel segment pairs in one line.