A:
暴力就可以通过
#include<bits/stdc++.h>
using namespace std;
long long solve(int x1,int y1,int x2,int y2 )
{
return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
int main()
{
int n;scanf("%d",&n);
int a[1005][2];
int cnt=0;
for(int i=1;i<=n;i++)
{
cin>>a[i][0]>>a[i][1];
}
for(int i = 1;i<=n;i++)
{
int x = a[i][0];
int y = a[i][1];long long fl;
if(i!=n)
fl= solve(x,y,a[(i+1)][0],a[(i+1)][1]);
else
fl = solve(x,y,a[(i-1)][0],a[(i-1)][1]);
int j = 1;
for(;j<=n;j++)
{
if(i==j)
continue;
if(fl!=solve(x,y,a[j][0],a[j][1]))
break;
}
if(j==n+1)
{
cout<<i<<endl;
cnt=1;
break;
}
}
if(cnt==0)
{
cout<<-1<<endl;
}
return 0;
}