#P2665. [USACO08FEB] Game of Lines S

[USACO08FEB] Game of Lines S

题目背景

Farmer John 最近发明了一个游戏,来考验自命不凡的贝茜。

题目描述

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 Xi and Yi (-1,000 ≤ Xi ≤ 1,000; -1,000 ≤ Yi ≤ 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.

游戏开始的时 候,FJ 会给贝茜一块画着 N(2N200)N (2 \le N \le 200) 个不重合的点的木板,其中第 ii 个点的横、纵坐标分别为 XiX_i 和 $Y_i (-1000 \le X_i \le 1000, -1000 \le Y_i \le 1000)$。

贝茜可以选两个点画一条过它们的直线,当且仅当平面上不存在与画出直线 平行的直线。游戏结束时贝茜的得分,就是她画出的直线的总条数。为了在游戏中胜出,贝茜找到了你,希望你帮她计算一下最大可能得分。

输入格式

11 行: 输入 1 个正整数:NN

2N+12 \cdots N+1 行: 第 i+1i+1 行用 22 个用空格隔开的整数Xi,YiX_i,Y_i,描述了点 ii 的坐标。

输出格式

第 1 行: 输出 1 个整数,表示贝茜的最大得分,即她能画出的互不平行的线段数

4 
-1 1 
-2 0 
0 0 
1 1
4 

提示

贝茜能画出以下 44 种斜率的直线:1-10013\dfrac{1}{3} 以及 11