/*
Time:2019.11.15
Author: Goven
type:简单几何(同一条直线上最多由几个点)
err:
ref:
*/
#include<iostream>
using namespace std;
int x[1005], y[1005];
int main()
{
int n;
while (cin >> n) {
for (int i = 0 ; i < n; i++) {
cin >> x[i] >> y[i];
}
int x1, y1, cnt, max_c = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
cnt = 2;
y1 = y[j] - y[i];
x1 = x[j] - x[i];
for (int k = j + 1; k < n; k++) {
if (y1 * (x[k] - x[i]) == x1 * (y[k] - y[i])) cnt++;
}
max_c = max(max_c, cnt);
}
}
cout << max_c << endl;
}
return 0;
}
网友评论