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