3004: Game of Lines 连线游戏

内存限制:256 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:19 解决:12

题目描述

Farmer John has challenged Bessie to the following game:

FJ has a board with dots marked at N (2 ≤ N ≤ 200) distinct lattice points. Dot i has the integer coordinates X_i and Y_i (-1,000 ≤ X_i ≤ 1,000; -1,000 ≤ Y_i ≤ 1,000). Bessie can score a point in the game by picking two of the dots and drawing a straight line between them; however, she is not allowed to draw a line if she has already drawn another line that is parallel to that line.

Bessie would like to know her chances of winning, so she has asked you to help find the maximum score she can obtain.

输入

* Line 1: A single integer: N

* Lines 2..N+1: Line i+1 describes lattice point i with two space-separated integers: X_i and Y_i.

输出

* Line 1: A single integer representing the maximal number of lines Bessie can draw, no two of which are parallel.

样例输入 复制

4
-1 1
-2 0
0 0
1 1

样例输出 复制

4

提示

Bessie can draw lines of the following four slopes: -1, 0, 1/3, and 1.

USACO Feb08