显示代码纯文本
#include<cstring>
#include<stdio.h>
const int maxn=201;
int n;
struct din
{
int x,y;
};
din d[maxn];
int a,b,c;
int max(int x,int y)
{
if(x>y) return x;
else return y;
}
int jsline(int x,int y)
{
int ans=2;
if(d[x].x==d[y].x&&d[y].y==d[x].y) return ans;
for(int i=1;i<=n;i++)
if(x!=i&&y!=i)
{
if((d[x].x==d[i].x&&d[x].y==d[i].y)||(d[y].x==d[i].x&&d[y].y==d[i].y)) ans++;
else if(d[x].x==d[y].x&&d[y].x==d[i].x) ans++;
else if(d[x].x==d[y].x||d[y].x==d[i].x) continue;
else if(((double)(d[x].y-d[y].y)/(double)d[x].x-d[y].x)==((double)(d[y].y-d[i].y))/(double)(d[y].x-d[i].x)) ans++;
else continue;
}
return ans;
}
int main()
{
freopen("asm_fuel.in","r",stdin);
freopen("asm_fuel.out","w",stdout);
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d%d",&d[i].x,&d[i].y);
int ret=-2147483600;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
if(i!=j)
{
ret=max(ret,jsline(i,j));
}
printf("%d",ret);
}