criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int grid[6000][6000];
struct cord{
  int x,y;
  cord operator+(const cord& a)const{
    cord res;
    res.x=a.x+x;
    res.y=a.y+y;
    return res;
  }
  cord operator-(const cord& a)const{
    cord res;
    res.x=a.x-x;
    res.y=a.y-y;
    return res;
  }
  bool operator<=(const cord& a)const{
    if(a.x<=x && a.y<=y)return true;
    return false;
  }
};


void rev(cord& a){
  int tmp;
  tmp=a.x;
  a.x=a.y;
  a.y=-tmp;
}


int main(){
  int n;
  while(cin>>n,n){
    memset(grid,0,sizeof(grid));
    cord *x;
    x=new cord[n];
    for (int i = 0; i < n; i++){
      cin>>x[i].x>>x[i].y;
      grid[x[i].y][x[i].x]=1;
    }
    int ans=0;

    for (int i = 0; i < n; i++){
      cord a=x[i];
      for (int j = 0; j < n && j != i; j++){
	cord b=x[j];
	cord d;
	cord emp;
	emp.x=0;emp.y=0;
	d=a-b;
	rev(d);
	//cout << "d.x:" << d.x  << " d.y:" << d.y<< endl;
	//cout << "i:" << i << " j:" << j << endl;
	if(emp<=a+d && emp<=b+d &&
	   grid[a.y+d.y][a.x+d.x]==1 && 
	   grid[b.y+d.y][b.x+d.x]==1){
	  cord tmp=a-b;
	  ans=max(ans,tmp.x*tmp.x+tmp.y*tmp.y);
	  // cout << "ans:" << ans<< endl;
	}
	
	if(emp<=a-d && emp<=b-d &&
	   grid[a.y-d.y][a.x-d.x]==1 && 
	   grid[b.y-d.y][b.x-d.x]==1){
	  cord tmp=a-b;
	  ans=max(ans,tmp.x*tmp.x+tmp.y*tmp.y);
	  // cout << "ans:" << ans<< endl;
	}

      }

    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'memset' was not declared in this scope
   37 |     memset(grid,0,sizeof(grid));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<utility>
using namespace std;
int grid[6000][6000];
struct cord{
  int x,y;
  cord operator+(const cord& a)const{
    cord res;
    res.x=a.x+x;
    res.y=a.y+y;
    return res;
  }
  cord operator-(const cord& a)const{
    cord res;
    res.x=a.x-x;
    res.y=a.y-y;
    return res;
  }
  bool operator<=(const cord& a)const{
    if(a.x<=x && a.y<=y)return true;
    return false;
  }
};


void rev(cord& a){
  int tmp;
  tmp=a.x;
  a.x=a.y;
  a.y=-tmp;
}


int main(){
  int n;
  while(cin>>n,n){
    memset(grid,0,sizeof(grid));
    cord *x;
    x=new cord[n];
    for (int i = 0; i < n; i++){
      cin>>x[i].x>>x[i].y;
      grid[x[i].y][x[i].x]=1;
    }
    int ans=0;

    for (int i = 0; i < n; i++){
      cord a=x[i];
      for (int j = 0; j < n && j != i; j++){
	cord b=x[j];
	cord d;
	cord emp;
	emp.x=0;emp.y=0;
	d=a-b;
	rev(d);
	//cout << "d.x:" << d.x  << " d.y:" << d.y<< endl;
	//cout << "i:" << i << " j:" << j << endl;
	if(emp<=a+d && emp<=b+d &&
	   grid[a.y+d.y][a.x+d.x]==1 && 
	   grid[b.y+d.y][b.x+d.x]==1){
	  cord tmp=a-b;
	  ans=max(ans,tmp.x*tmp.x+tmp.y*tmp.y);
	  // cout << "ans:" << ans<< endl;
	}
	
	if(emp<=a-d && emp<=b-d &&
	   grid[a.y-d.y][a.x-d.x]==1 && 
	   grid[b.y-d.y][b.x-d.x]==1){
	  cord tmp=a-b;
	  ans=max(ans,tmp.x*tmp.x+tmp.y*tmp.y);
	  // cout << "ans:" << ans<< endl;
	}

      }

    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:5: error: 'memset' was not declared in this scope
   38 |     memset(grid,0,sizeof(grid));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<utility>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
/*namespace std {
	bool operator < (const int& a, const int& b) {
		return 
		//return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
		//return imag(a) != imag(b) ? imag(a) < imag(b) : real(a) < real(b);  
	}
}*/
bool in[5001][5001];
int main(){
	int n;
	while(cin>>n,n){
		memset(in,0,sizeof(in));
		vector<int>x(n);
		vector<int>y(n);
		rep(i,n){
			cin>>x[i]>>y[i];
			in[x[i]][y[i]]=true;
		}
		rep(i,n)rep(j,n)if(x[i]<x[j]){swap(x[i],x[j]);swap(y[i],y[j]);}
			else if(x[i]==x[j]&&y[i]<y[j])swap(y[i],y[j]);

		int out=0;
		rep(i,n){
			loop(j,i+1,n){
				if(x[i]+y[j]-y[i]<5001&&x[j]+y[j]-y[i]<5001&&
				y[i]+x[i]-x[j]<5001&&y[j]+x[i]-x[j]<5001&&
				x[i]+y[j]-y[i]>=0&&x[j]+y[j]-y[i]>=0&&
				y[i]+x[i]-x[j]>=0&&y[j]+x[i]-x[j]>=0&&				in[x[i]+y[j]-y[i]][y[i]+x[i]-x[j]]&&
				in[x[j]+y[j]-y[i]][y[j]+x[i]-x[j]])
					out=max(out,(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
			}
		}
		cout<<out<<endl;
	}
		//rep(i,n)cout<<x[i]<<" "<<y[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: 'memset' was not declared in this scope
   32 |                 memset(in,0,sizeof(in));
      |                 ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include<cstdio>
  +++ |+#include <cstring>
   10 | #define loop(i,a,b) for(int i=a;i<b;i++)
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int N;
int X[3000], Y[3000];
bool F[5001][5001];
int solve(int P, int Q){
	int xp = X[P];
	int yp = Y[P];
	int xq = X[Q];
	int yq = Y[Q];
	int xs = xp + (yp - yq);
	int ys = yp + (xq - xp);
	int xr = xq + (yp - yq);
	int yr = yq + (xq - xp);
	if ((xs>=0&&xs<=5000)&&(ys>=0&&ys<=5000)&&(xr>=0&&xr<=5000)&&(yr>=0&&yr<=5000)&&F[xs][ys]&&F[xr][yr])return (xq - xp)*(xq - xp) + (yq - yp)*(yq - yp);
	xs = xp - (yp - yq);
	ys = yp - (xq - xp);
	xr = xq - (yp - yq);
	yr = yq - (xq - xp);
	if ((xs >= 0 && xs<=5000) && (ys >= 0 && ys<=5000) && (xr >= 0 && xr<=5000) && (yr >= 0 && yr<=5000) && F[xs][ys] && F[xr][yr])return (xq - xp)*(xq - xp) + (yq - yp)*(yq - yp);
	return 0;
}
int main()
{
	while (true){
		scanf_s("%d", &N);
		if (N == 0)return 0;
		for (int i = 0; i < N; i++){
			scanf_s("%d%d", &X[i], &Y[i]);
			F[X[i]][Y[i]] = true;
		}
		int ans = 0;
		for (int i = 0; i < N; i++){
			for (int j = i + 1; j < N; j++){
				ans = max(ans, solve(i, j));

			}
		}
		printf("%d\n", ans);
		for (int i = 0; i < N; i++)F[X[i]][Y[i]] = false;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   28 |                 scanf_s("%d", &N);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>

using namespace std;

#define x first
#define y second

int main() {
    int n;
    while (cin >> n, n) {
        map<int, bool> has;
        vector<pair<int,int> > co(n);
        for (int i=0; i<n; ++i) {
            cin >> co[i].x >> co[i].y;
            has[x+10000*y] = true;
        }
        sort(co.begin(), co.end());

        int area = 0;
        for (int i=0; i<(int)co.size(); ++i) {
            for (int j=i+1; j<(int)co.size(); ++j) {
                int x1, y1, x2, y2, x3, y3, x4, y4, dx, dy;
                x1 = co[i].x; y1 = co[i].y;
                x2 = co[j].x; y2 = co[j].y;
                dx = x2 - x1; dy = y2 - y1;
                x3 = co[j].x - dy; y3 = co[j].y + dx;
                x4 = co[i].x - dy; y4 = co[i].y + dx;
                if (has[x3+10000*y3] && has[x4+10000*y4]) {
                    area = max(area, abs((x1-x2)*(y3-y2)-(x3-x2)*(y1-y2)));
                }
            }
        }
        cout << area << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'first' was not declared in this scope
   11 | #define x first
      |           ^~~~~
a.cc:21:17: note: in expansion of macro 'x'
   21 |             has[x+10000*y] = true;
      |                 ^
a.cc:12:11: error: 'second' was not declared in this scope
   12 | #define y second
      |           ^~~~~~
a.cc:21:25: note: in expansion of macro 'y'
   21 |             has[x+10000*y] = true;
      |                         ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(int)(n);i++)
#define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define pb(a) push_back(a)
#define mp(x,y) make_pair(x,y)
#define ZERO(a) memset(a,0,sizeof(a))
#define len(a) sizeof(a)
#define ll long long
#define pii pair<int,int>
#define INF 1<<29
#define MAX 511;
using namespace std;

int x[MAX],y[MAX];

void solve(){
 int n;
 for(;;){
  cin>>n;
  if(!n) break;
  FOR(i,n) cin>>x[i]>>y[i];
  set<pii> st;
  FOR(i,n) st.insert(mp(x[i],y[i]));
  int ma=0;
  FOR(i,n){
   FORR(j,i+1,n){
    pii v(x[j]-x[i],y[j]-y[i]),p(x[i]+v.second,y[i]-v.first),q(x[j]+v.second,y[j]-v.first),r(x[i]-v.second,y[i]+v.first),s(x[j]-v.second,y[j]+v.first);
    if((st.find(p)!=st.end()&&st.find(q)!=st.end())||(st.find(r)!=st.end()&&st.find(s)!=st.end())){
     ma=max(ma,abs(2*v.first*v.second));
    }
   }
  }
  cout<<ma<<endl;
 } 
}

int main(){
 solve();
 return 0;
}

Compiler output:
a.cc:11:16: error: expected ']' before ';' token
   11 | #define MAX 511;
      |                ^
a.cc:14:7: note: in expansion of macro 'MAX'
   14 | int x[MAX],y[MAX];
      |       ^~~
a.cc:14:10: error: expected unqualified-id before ']' token
   14 | int x[MAX],y[MAX];
      |          ^
a.cc:14:17: error: expected unqualified-id before ']' token
   14 | int x[MAX],y[MAX];
      |                 ^
a.cc: In function 'void solve()':
a.cc:21:17: error: 'x' was not declared in this scope
   21 |   FOR(i,n) cin>>x[i]>>y[i];
      |                 ^
a.cc:21:23: error: 'y' was not declared in this scope
   21 |   FOR(i,n) cin>>x[i]>>y[i];
      |                       ^
a.cc:23:25: error: 'x' was not declared in this scope
   23 |   FOR(i,n) st.insert(mp(x[i],y[i]));
      |                         ^
a.cc:5:27: note: in definition of macro 'mp'
    5 | #define mp(x,y) make_pair(x,y)
      |                           ^
a.cc:23:30: error: 'y' was not declared in this scope
   23 |   FOR(i,n) st.insert(mp(x[i],y[i]));
      |                              ^
a.cc:5:29: note: in definition of macro 'mp'
    5 | #define mp(x,y) make_pair(x,y)
      |                             ^
a.cc:27:11: error: 'x' was not declared in this scope
   27 |     pii v(x[j]-x[i],y[j]-y[i]),p(x[i]+v.second,y[i]-v.first),q(x[j]+v.second,y[j]-v.first),r(x[i]-v.second,y[i]+v.first),s(x[j]-v.second,y[j]+v.first);
      |           ^
a.cc:27:21: error: 'y' was not declared in this scope
   27 |     pii v(x[j]-x[i],y[j]-y[i]),p(x[i]+v.second,y[i]-v.first),q(x[j]+v.second,y[j]-v.first),r(x[i]-v.second,y[i]+v.first),s(x[j]-v.second,y[j]+v.first);
      |                     ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(int)(n);i++)
#define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ZERO(a) memset(a,0,sizeof(a))
#define len(a) sizeof(a)
#define ll long long
#define pii pair<int,int>
#define INF 1<<29
#define MAX 511;
using namespace std;

int x[MAX],y[MAX];

void solve(){
 int n;
 for(;;){
  cin>>n;
  if(!n) break;
  FOR(i,n) cin>>x[i]>>y[i];
  set<pii> st;
  FOR(i,n) st.insert(mp(x[i],y[i]));
  int ma=0;
  FOR(i,n){
   FORR(j,i+1,n){
    pii v(x[j]-x[i],y[j]-y[i]),p(x[i]+v.second,y[i]-v.first),q(x[j]+v.second,y[j]-v.first),r(x[i]-v.second,y[i]+v.first),s(x[j]-v.second,y[j]+v.first);
    if((st.find(p)!=st.end()&&st.find(q)!=st.end())||(st.find(r)!=st.end()&&st.find(s)!=st.end())){
     ma=max(ma,abs(2*v.first*v.second));
    }
   }
  }
  cout<<ma<<endl;
 } 
}

int main(){
 solve();
 return 0;
}

Compiler output:
a.cc:11:16: error: expected ']' before ';' token
   11 | #define MAX 511;
      |                ^
a.cc:14:7: note: in expansion of macro 'MAX'
   14 | int x[MAX],y[MAX];
      |       ^~~
a.cc:14:10: error: expected unqualified-id before ']' token
   14 | int x[MAX],y[MAX];
      |          ^
a.cc:14:17: error: expected unqualified-id before ']' token
   14 | int x[MAX],y[MAX];
      |                 ^
a.cc: In function 'void solve()':
a.cc:21:17: error: 'x' was not declared in this scope
   21 |   FOR(i,n) cin>>x[i]>>y[i];
      |                 ^
a.cc:21:23: error: 'y' was not declared in this scope
   21 |   FOR(i,n) cin>>x[i]>>y[i];
      |                       ^
a.cc:23:25: error: 'x' was not declared in this scope
   23 |   FOR(i,n) st.insert(mp(x[i],y[i]));
      |                         ^
a.cc:5:27: note: in definition of macro 'mp'
    5 | #define mp(a,b) make_pair(a,b)
      |                           ^
a.cc:23:30: error: 'y' was not declared in this scope
   23 |   FOR(i,n) st.insert(mp(x[i],y[i]));
      |                              ^
a.cc:5:29: note: in definition of macro 'mp'
    5 | #define mp(a,b) make_pair(a,b)
      |                             ^
a.cc:27:11: error: 'x' was not declared in this scope
   27 |     pii v(x[j]-x[i],y[j]-y[i]),p(x[i]+v.second,y[i]-v.first),q(x[j]+v.second,y[j]-v.first),r(x[i]-v.second,y[i]+v.first),s(x[j]-v.second,y[j]+v.first);
      |           ^
a.cc:27:21: error: 'y' was not declared in this scope
   27 |     pii v(x[j]-x[i],y[j]-y[i]),p(x[i]+v.second,y[i]-v.first),q(x[j]+v.second,y[j]-v.first),r(x[i]-v.second,y[i]+v.first),s(x[j]-v.second,y[j]+v.first);
      |                     ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(int)(n);i++)
#define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ZERO(a) memset(a,0,sizeof(a))
#define len(a) sizeof(a)
#define ll long long
#define pii pair<int,int>
#define INF 1<<29
#define MAX 3333
using namespace std;

int x[MAX],y[MAX];

void solve(){
 int n;
 for(;;){
  cin>>n;
  if(!n) break;
  FOR(i,n) cin>>x[i]>>y[i];
  set<pii> st;
  FOR(i,n) st.insert(mp(x[i],y[i]));
  int ma=0;
  FOR(i,n){
   FORR(j,i+1,n){
    pii v(x[j]-x[i],y[j]-y[i]),p(x[i]+v.second,y[i]-v.first),q(x[j]+v.second,y[j]-v.first),r(x[i]-v.second,y[i]+v.first),s(x[j]-v.second,y[j]+v.first);
    if((st.find(p)!=st.end()&&st.find(q)!=st.end())||(st.find(r)!=st.end()&&st.find(s)!=st.end())){
     ma=max(ma,v.first*v.first+v.second*v.second));
    }
   }
  }
  cout<<ma<<endl;
 } 
}

int main(){
 solve();
 return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:29:50: error: expected ';' before ')' token
   29 |      ma=max(ma,v.first*v.first+v.second*v.second));
      |                                                  ^
      |                                                  ;
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>

#define INF_LL 9000000000000000000
#define INF 2000000000

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef pair<int, PII> PPII;
typedef pair<int, PPII> PPPII;

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

bool fld[5010][5010];
int main(void){
	int n;
	while(cin >> n && n){
	vector<PII> p;
	int res = 0;
	memset(fld, 0, sizeof(fld));
	REP(i, n){
		int x, y;
		cin >> x >> y;
		p.push_back({x, y});
		fld[x][y] = true;
	}
	REP(i, n){
		REP(j, n){
			if(i == j) continue;
			int x = p[j].first-p[i].first;
			int y = p[j].second-p[i].second;
			int dx[4] = {x, -y, -x, y};
			int dy[4] = {y, x, -y, -x};
			bool flag = true;
			int bx = p[i].first, by = p[i].second;
			REP(k, 4){
				if((bx < 0 || 5000 < bx || by < 0 || 5000 < by) || !fld[bx][by]){
					flag = false;
					break;
				}
				bx += dx[k];
				by += dy[k];
			}
			if(flag) res = max(res, x*x+y*y);
		}
	}
	cout << res << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:9: error: 'memset' was not declared in this scope
   70 |         memset(fld, 0, sizeof(fld));
      |         ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <cmath>
  +++ |+#include <cstring>
    9 |
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*) array, (T*) (array + N), val);
}
pii Dir [] = {
	{ 1,0 },{ 0,1 }
};

signed main() {
	int n;
	while (scanf("%d", &n)) {
		if (!n)
			break;

		vector<vector<int>> m(5001,vector<int>(5001));
		vector<pii> st;
		REP(i, n) {
			int x, y;
			scanf("%d %d", &x, &y);
			m[x][y] = 1;
			st.push_back({ x,y });
		}
		sort(ALL(st));
		int ans = 0;
		REP(i, n) {
			rep(j, i + 1, n) {
				pii sa = { st[j].first - st[i].first, st[j].second - st[i].second };
				bool f = 0;
				pii nex = { st[j].first+sa.second, st[j].second-sa.first };
				pii nexx = { cur.first - sa.first, cur.second - sa.second };
				if (RANGE(nex.first, 0, 5000) && RANGE(nex.second, 0, 5000) && RANGE(nexx.first, 0, 5000) & RANGE(nexx.second, 0, 5000)) {
					if (m[nex.first][nex.second] && m[nexx.first][nexx.second]) {
						ans = max(ans, PW(sa.first)+ PW(sa.second));
					}
				}
			}
		}
		printf("%d\n", ans);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:46: error: 'cur' was not declared in this scope
   73 |                                 pii nexx = { cur.first - sa.first, cur.second - sa.second };
      |                                              ^~~
a.cc:73:91: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'pii' {aka 'std::pair<int, int>'}
   73 |                                 pii nexx = { cur.first - sa.first, cur.second - sa.second };
      |                                                                                           ^
      |                                                                                           |
      |                                                                                           <brace-enclosed initializer list>
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
using namespace std;
struct P{
	int x,y;
};
int main() {
	int n;
	while(cin>>n&&n!=0){
		P a[3000];
		for(int i=0;i<n;i++){
			cin>>a[i].x>>a[i].y;
		}
		int sum=0;
		for(int i=0;i<n;i++){
		int x1=a[i].x,y1=a[i].y;
		for(int j=0;j<n;j++){
			if(i!=j&&a[j].x>=x1&&a[j].y>=y1){
				  int x2=a[j].x,y2=a[j].y;  
				  int x3=x2-x1,y3=y2-y1;
				  int x4=x2-y3,y4=y2+x3;
				  for(int j=0;j<n;j++){
					if(a[j].x==x4&&a[j].y==y4){
						goto sto;
					}
				  }
				  goto stop;
				  sto:;
				  int x5=(x4-x3),y5=(y4-y3);
				  for(int j=0;j<n;j++){
					  if(a[j].x==x5&&a[j].y==y5){
						  goto stp;
					  }
				  }
				  goto stop;
				  stp:;
				  int sum2=(x2-x5)*(y4-y1);
				  sum2-=((x3*y3)*2);
				  sum=max(sum,sum2);
				  stop:;
			  }
			}
		}
	}
	cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:35: error: jump to label 'stop'
   46 |                                   stop:;
      |                                   ^~~~
a.cc:41:40: note:   from here
   41 |                                   goto stop;
      |                                        ^~~~
a.cc:43:39: note:   crosses initialization of 'int sum2'
   43 |                                   int sum2=(x2-x5)*(y4-y1);
      |                                       ^~~~
a.cc:46:35: error: jump to label 'stop'
   46 |                                   stop:;
      |                                   ^~~~
a.cc:33:40: note:   from here
   33 |                                   goto stop;
      |                                        ^~~~
a.cc:43:39: note:   crosses initialization of 'int sum2'
   43 |                                   int sum2=(x2-x5)*(y4-y1);
      |                                       ^~~~
a.cc:35:50: note:   crosses initialization of 'int y5'
   35 |                                   int x5=(x4-x3),y5=(y4-y3);
      |                                                  ^~
a.cc:35:39: note:   crosses initialization of 'int x5'
   35 |                                   int x5=(x4-x3),y5=(y4-y3);
      |                                       ^~
a.cc:51:15: error: 'sum' was not declared in this scope
   51 |         cout<<sum<<endl;
      |               ^~~
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
typedef pair<int, int> P;
set<P> SET;
vector<P> point;
int main()
{
  int n;
  while(cin>>n,n) {
    CLR(isp);
    FOR(i,0,n) {
      int y, x; cin >> y >> x;
      SET.insert(P(y, x));
      point.push_back(P(y, x));
    }
    int ans = 0;
    FOR(i,0,n) {
      int y = point[i].first;
      int x = point[i].second;
      FOR(j,0,n) {
        if(i == j) continue;
        int yy = point[j].first;
        int xx = point[j].second;

        int dy = yy - y;
        int dx = xx - x;

        if(dy >= 0 && dx >= 0) {
          int Y = yy - dx;
          int X = xx + dy;
          if(Y > 5000 || X > 5000 || SET.count(P(Y, X)) == 0) continue;

          Y = Y - dy;
          X = X - dx;
          if(Y > 5000 || X > 5000 || SET.count(P(Y, X)) == 0) continue;

          Y = Y + dx;
          X = X - dy;

          if(y == Y && x == X) {
            ans = max(ans, (dy+dx)*(dy+dx)-dy*dx*2);
          }
        }
      }
    }
    cout << ans << '\n';
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'isp' was not declared in this scope
   27 |     CLR(isp);
      |         ^~~
a.cc:18:25: note: in definition of macro 'CLR'
   18 | #define CLR(mat) memset(mat, 0, sizeof(mat))
      |                         ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <array>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INT_MAX 2000000000
#define MOD 1000000007
#define rep(i,aa,bb) for(i = (aa); i < (bb); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vsort(x) sort(x.begin(),x.end())
using int64 = long long int;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*)array, (T*)(array + N), val);
}

using namespace std;
bool h[5001][5001] = {};

int main() {
	int n;
	int a[3000], b[3000];


	int c;
	int i, j, k;
	int ans[10] = {};
	int e;
	int dx, dy;
	rep(e, 0, 10) {
		memset(h, sizeof(h), 0);
		n = 1;
		cin >> n;
		if (n == 0) {
			c = e;
			break;
		}
		rep(i, 0, n) {
			cin >> a[i] >> b[i];
			h[a[i]][b[i]] = 1;
		}
		rep(i, 0, n) {
			rep(j, 0, n) {
				if (i != j) {
					dy = a[i] - a[j];
					dx = b[j] - b[i];
					if ((0 <= a[i] + dx)&(a[i] + dx <= 5000) & (0 <= b[i] + dy)&(b[i] + dy <= 5000) & (0 <= a[j] + dx)&(a[j] + dx <= 5000) & (0 <= b[j] + dy)&(b[j] + dy <= 5000)) {
						if (h[a[i] + dx][b[i] + dy] == 1 & h[a[j] + dx][b[j] + dy] == 1) {
							ans[e] = max(dx*dx + dy*dy, ans[e]);
						}
					}
				}
			}
		}
	}
	rep(k, 0, c) {
		cout << ans[k] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:17: error: 'memset' was not declared in this scope
   36 |                 memset(h, sizeof(h), 0);
      |                 ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <vector>
  +++ |+#include <cstring>
    9 |
Language: C++

#include <iostream>
#include <algorithm>
#include <array>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INT_MAX 2000000000
#define MOD 1000000007
#define rep(i,aa,bb) for(i = (aa); i < (bb); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vsort(x) sort(x.begin(),x.end())
using int64 = long long int;

using namespace std;
bool h[5001][5001] = {};

int main() {
	int n;
	int a[3000], b[3000];


	int c;
	int i, j, k;
	int ans[10] = {};
	int e;
	int dx, dy;
	rep(e, 0, 10) {
		memset(h, sizeof(h), 0);
		n = 1;
		cin >> n;
		if (n == 0) {
			c = e;
			break;
		}
		rep(i, 0, n) {
			cin >> a[i] >> b[i];
			h[a[i]][b[i]] = 1;
		}
		rep(i, 0, n) {
			rep(j, 0, n) {
				if (i != j) {
					dy = a[i] - a[j];
					dx = b[j] - b[i];
					if ((0 <= a[i] + dx)&(a[i] + dx <= 5000) & (0 <= b[i] + dy)&(b[i] + dy <= 5000) & (0 <= a[j] + dx)&(a[j] + dx <= 5000) & (0 <= b[j] + dy)&(b[j] + dy <= 5000)) {
						if (h[a[i] + dx][b[i] + dy] == 1 & h[a[j] + dx][b[j] + dy] == 1) {
							ans[e] = max(dx*dx + dy*dy, ans[e]);
						}
					}
				}
			}
		}
	}
	rep(k, 0, c) {
		cout << ans[k] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: 'memset' was not declared in this scope
   32 |                 memset(h, sizeof(h), 0);
      |                 ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <vector>
  +++ |+#include <cstring>
    9 |
Language: C++

#include <bits/stdc++.h>
#define int long long
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef pair<double,double>P;
int n,x[3001],y[3001];
set<P>st;
int main(){
	while(cin>>n,n){
		st.clear();
		r(i,n){
			cin>>x[i]>>y[i];
			st.insert(P(x[i],y[i]));
		}
		int ans=0;
		r(i,n)r(j,n)if(i!=j){
			int tx1=x[i]-x[j],ty1=y[i]-y[j];
			int tx2=x[i]+ty1,ty2=y[i]-tx1;
			int tx3=x[j]+ty1,ty3=y[j]-tx1;
			int tx4=x[i]-ty1,ty4=y[i]+tx1;
			int tx5=x[j]+ty1,ty5=y[j]+tx1;
			if(st.count(P(tx2,ty2))&&st.count(P(tx3,ty3))||
			   st.count(P(tx4,ty4))&&st.count(P(tx5,ty5))){
				ans=max(ans,tx1*tx1+ty1*ty1);
			}
		}
		cout<<ans<<endl;
	}
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

int main(){
    while(1){
    int n;
    cin >> n;
        if(n==0) break;
    int X[1001],Y[1001];
    bool exi[1001][1001];
    for(int i=1; i<=n; i++){
        cin >> X[i] >> Y[i];
        exi[X[i]][Y[i]] = true;
    }
        bool sik=false;
    priority_queue<int> PQ;
    for(int i=1; i<n; i++){
        for(int j=1; j<=n; j++){
            int dx = X[j]-X[i];
            int dy = Y[j]-Y[i];
            if(exi[X[i]+dy][Y[i]-dx]==true && exi[X[j]+dy][Y[j]-dx]==true){
                PQ.push(dx*dx + dy*dy);
                sik = true;
            }
            if(exi[X[i]-dy][Y[i]+dx]==true && exi[X[j]-dy][Y[j]+dx]==true){
                PQ.push(dx*dx + dy*dy);
                sik = true;
            }
        }
    }
        if(sik) cout << PQ.top() << endl;
        else cout << 0 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> n;
      |     ^~~
a.cc:13:5: error: 'priority_queue' was not declared in this scope
   13 |     priority_queue<int> PQ;
      |     ^~~~~~~~~~~~~~
a.cc:13:20: error: expected primary-expression before 'int'
   13 |     priority_queue<int> PQ;
      |                    ^~~
a.cc:19:17: error: 'PQ' was not declared in this scope
   19 |                 PQ.push(dx*dx + dy*dy);
      |                 ^~
a.cc:23:17: error: 'PQ' was not declared in this scope
   23 |                 PQ.push(dx*dx + dy*dy);
      |                 ^~
a.cc:28:17: error: 'cout' was not declared in this scope
   28 |         if(sik) cout << PQ.top() << endl;
      |                 ^~~~
a.cc:28:25: error: 'PQ' was not declared in this scope
   28 |         if(sik) cout << PQ.top() << endl;
      |                         ^~
a.cc:28:37: error: 'endl' was not declared in this scope
   28 |         if(sik) cout << PQ.top() << endl;
      |                                     ^~~~
a.cc:29:14: error: 'cout' was not declared in this scope
   29 |         else cout << 0 << endl;
      |              ^~~~
a.cc:29:27: error: 'endl' was not declared in this scope
   29 |         else cout << 0 << endl;
      |                           ^~~~
Language: C++

#include <iostream>
using namespace std;

bool exi[5005][5005];

bool c(int a){
    return 0<=a&&a<=5000;
}
int main(){
    while(1){
        int X[5005],Y[5005];
        int n,au = 0;
        cin >> n;
        if(n==0) break;
        for(int i=0; i<n; i++) cin >> X[i] >> Y[i]; exi[X[i]][Y[i]] = true;
        for(int i=0; i<n; i++){
            for(int j=i; j<n; j++){
                int dx = X[i]-X[j];
                int dy = Y[i]-Y[j];
                int x1 = X[i]+dy; int x2 = X[j]-dy;
                int y1 = Y[i]-dx; int y2 = Y[j]+dx;
                if(exi[x1][y1]&&exi[x2][y2]&&c(x1)&&c(y1)&&c(x2)&&c(y2))
                    au = max(au, dx*dx+dy*dy);
                if(exi[x2][y2]&&exi[x1][y1]&&c(x2)&&c(y2)&&c(x1)&&c(y1))
                    au = max(au, dx*dx+dy*dy);
            }
        }
        cout << au << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:59: error: 'i' was not declared in this scope
   15 |         for(int i=0; i<n; i++) cin >> X[i] >> Y[i]; exi[X[i]][Y[i]] = true;
      |                                                           ^
Language: C++

#include <iostream>
using namespace std;
int n;
bool exi[5001][5001];
bool c(int a){
    return 0<=a&&a<=5000;
}
int main(){
    while(cin>>n&&n){
        int X[5001],Y[5001];
        int an = 0;
        for(int i=0; i<n; i++) {
            cin >> X[i] >> Y[i];
            exi[X[i]][Y[i]] = 1;
        }
        for(int i=0; i<n; i++)
            for(int j=i; j<n; j++){
                int dx = X[i]-X[j];
                int dy = Y[i]-Y[j];
                int x1 = X[i]-dy; int x2 = X[j]-dy;
                int y1 = Y[i]+dx; int y2 = Y[j]+dx;
                int x3 = X[i]-dy,y3 = Y[i]+dx,x4=X[j]+dy,y4=Y[j]-dx;
                if(exi[x1][y1]&&exi[x2][y2]&&c(x1)&&c(y1)&&c(x2)&&c(y2))
                    au = max(an, dx*dx+dy*dy);
                if(exi[x3][y3]&&exi[x4][y4]&&c(x3)&&c(y3)&&c(x4)&&c(y4))
                    au = max(an, dx*dx+dy*dy);
            }
        cout<<an<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'au' was not declared in this scope; did you mean 'an'?
   24 |                     au = max(an, dx*dx+dy*dy);
      |                     ^~
      |                     an
a.cc:26:21: error: 'au' was not declared in this scope; did you mean 'an'?
   26 |                     au = max(an, dx*dx+dy*dy);
      |                     ^~
      |                     an
Language: C++

#include <iostream>
using namespace std;
int n;
bool p[5001][5001];
bool c(int a){
    return 0<=a&&a<=5000;
}
int main(){
    while(cin>>n&&n){
        int x[5001],y[5001];
        int an = 0;
        for(int i=0; i<n; i++) {
            cin >> x[i] >> y[i];
            exi[x[i]][y[i]] = 1;
        }
        for(int i=0; i<n; i++)
            for(int j=i; j<n; j++){
                int dx = x[i]-y[j];
                int dy = x[i]-y[j];
                int x1 = x[i]-dy; int x2 = x[j]-dy;
                int y1 = y[i]+dx; int y2 = y[j]+dx;
                int x3 = x[i]-dy,y3 = y[i]+dx,x4=x[j]+dy,y4=y[j]-dx;
                if(exi[x1][y1]&&exi[x2][y2]&&c(x1)&&c(y1)&&c(x2)&&c(y2))
                    an = max(an, dx*dx+dy*dy);
                if(exi[x3][y3]&&exi[x4][y4]&&c(x3)&&c(y3)&&c(x4)&&c(y4))
                    an = max(an, dx*dx+dy*dy);
            }
        cout<<an<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'exi' was not declared in this scope; did you mean 'exit'?
   14 |             exi[x[i]][y[i]] = 1;
      |             ^~~
      |             exit
a.cc:23:20: error: 'exi' was not declared in this scope; did you mean 'exit'?
   23 |                 if(exi[x1][y1]&&exi[x2][y2]&&c(x1)&&c(y1)&&c(x2)&&c(y2))
      |                    ^~~
      |                    exit
a.cc:25:20: error: 'exi' was not declared in this scope; did you mean 'exit'?
   25 |                 if(exi[x3][y3]&&exi[x4][y4]&&c(x3)&&c(y3)&&c(x4)&&c(y4))
      |                    ^~~
      |                    exit
Language: C++

#include <iostream>
using namespace std;
int n;
bool p[5001][5001];
bool c(int a){
    return 0<=a&&a<=5000;
}
int main(){
    while(cin>>n&&n){
        int x[5000],y[5001],an=0;
        for(int i=0;i<n;i++)cin>>x[i]>>y[i],p[x[i]][y[i]]=1;
        for(int i=0;i<n;i++)
            for(int j=i;j<n;j++){
                int dx = x[i]-x[j];
                int dy = y[i]-y[j];
                int x1 = x[i]-dy; int x2 = x[j]-dy;
                int y1 = y[i]+dx; int y2 = y[j]+dx;
                int x3 = x[i]-dy, y3 = y[i]+dx,x4 = x[j]+dy,y4 = y[j]-dx;
                if(exi[x1][y1]&&exi[x2][y2]&&c(x1)&&c(y1)&&c(x2)&&c(y2))
                    an = max(an, dx*dx+dy*dy);
                if(exi[x3][y3]&&exi[x4][y4]&&c(x3)&&c(y3)&&c(x4)&&c(y4))
                    an = max(an, dx*dx+dy*dy);
            }
        cout<<an<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: 'exi' was not declared in this scope; did you mean 'exit'?
   19 |                 if(exi[x1][y1]&&exi[x2][y2]&&c(x1)&&c(y1)&&c(x2)&&c(y2))
      |                    ^~~
      |                    exit
a.cc:21:20: error: 'exi' was not declared in this scope; did you mean 'exit'?
   21 |                 if(exi[x3][y3]&&exi[x4][y4]&&c(x3)&&c(y3)&&c(x4)&&c(y4))
      |                    ^~~
      |                    exit
Language: C++

#include <iostream>
using namespace std;
int n;
bool p[5001][5001];
bool c(int a){
    return 0<=a&&a<=5000;
}
int main(){
    while(cin>>n&&n){
        int x[5001],y[5001],an = 0;
        for(int i=0; i<n; i++) cin >> x[i] >> y[i],p[x[i]][y[i]] = 1;
        for(int i=0; i<n; i++)
            for(int j=i; j<n; j++){
                int dx = x[i]-x[j];
                int dy = y[i]-y[j];
                int x1 = x[i]-dy; int x2 = x[j]-dy;
                int y1 = y[i]+dx; int y2 = y[j]+dx;
                int x3 = x[i]-dy,y3 = y[i]+dx,x4=x[j]+dy,y4=y[j]-dx;
                if(c(x1)&&c(y1)&&p[x1][y1]&&c(x2)&&c(y2)&&p[x2][y2])
                    an = max(an, dx*dx+dy*dy);
                if((x3)&&c(y3)&&p[x3][y3]&&cc(x4)&&c(y4)&&p[x4][y4])
                    an = max(an, dx*dx+dy*dy);
            }
        cout<<an<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:44: error: 'cc' was not declared in this scope; did you mean 'c'?
   21 |                 if((x3)&&c(y3)&&p[x3][y3]&&cc(x4)&&c(y4)&&p[x4][y4])
      |                                            ^~
      |                                            c
Language: C++

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
#include<fstream>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define P pair<int,int>
#define ll __int64
int n;
int x[4000],y[4000];
map<P,bool>table;

inline bool isRect(P t1,P t2){
	int x1,x2,y1,y2,dx,dy,vx,vy;	
	if(t1.first>t2.first)swap(t1,t2);

	x1=t1.first;
	x2=t2.first;
	y1=t1.second;
	y2=t2.second;

	dx=x2-x1;
	dy=y2-y1;
	vx=dy;
	vy=-dx;
	//cout<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<" "<<dx<<" "<<dy<<endl;
	return (table[mp(x1+vx,y1+vy)])&&(table[mp(x2+vx,y2+vy)]);
}

int main(){
while(cin>>n,n){
table.clear();
memset(x,0,sizeof x);
memset(y,0,sizeof y);
rep(i,n){
	cin>>x[i]>>y[i];
	table[mp(x[i],y[i])]=1;
}
int ans=0;

for(int i=0;i<n;i++){
	for(int j=i+1;j<n;j++){
		if(isRect(mp(x[i],y[i]),mp(x[j],y[j]))){
			ans=max(ans,((x[i]-x[j])*(x[i]-x[j]))+((y[i]-y[j])*(y[i]-y[j])));
			//cout<<x[i]<<" "<<y[i]<<" "<<x[j]<<" "<<y[j]<<endl;
		}
	}
}
cout<<ans<<endl;
}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:1: error: 'memset' was not declared in this scope
   41 | memset(x,0,sizeof x);
      | ^~~~~~
a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   11 | #include<fstream>
  +++ |+#include <cstring>
   12 | using namespace std;
Language: C++

#include<cstdio>
#include<vector>
#include<algorithm>
#include<set>
#define men(d) (((d.vx*d.vx)+(d.vy*d.vy))/2)
using namespace std;
struct Data{
    unsigned short vx : 13;
    signed short vy : 14;
    unsigned short cx : 13;
    unsigned short cy : 13;
    Data(unsigned short a,signed short b,unsigned short c,unsigned short d){
        vx=a;
        vy=b;
        cx=c;
        cy=d;
    }
    Data(){}
};
inline bool operator<(const Data &a,const Data &b){
    if(a.vx<b.vx)return true;
    if(a.vx==b.vx&&a.vy<b.vy)return true;
    if(a.vx==b.vx&a.vy==b.vy&&a.cx<b.cx)return true;
    if(a.vx==b.vx&&a.vy==b.vy&&a.cx==b.cx&&a.cy<b.cy)return true;
    return false;
}
inline bool operator==(const Data &a,const Data &b){
    return a.vx==b.vx&&a.vy==b.vy&&a.cx==b.cx&&a.cy==b.cy;
}
int main(){
    int n;
    for(;;){
        scanf("%d",&n);
        if(n==0)break;
        vector<pair<int,int> > ins(n);
        for(int i=0;i<n;i++){
            int x,y;
            scanf("%d%d",&x,&y);
            ins[i]=make_pair(x,y);
        }
        vector<Data> high,mid,low;
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                int tx=ins[i].fisrt-ins[j].first,ty=ins[i].second-ins[j].second;
                Data d;
                if(tx>=0){
                    d.vx=tx;
                    d.vy=ty;
                }else{
                    d.vx=-tx;
                    d.vy=-ty;
                }
                d.cx=(ins[i].first+ins[j].first)/2;
                d.cy=(ins[i].second+ins[j].second)/2;
                if(d.vy==0)mid.push_back(d);
                else if(d.vy>0)high.push_back(d);
                else low.push_back(d);
            }
        }
        sort(&high[0],&high[0]+high.size());
        sort(&mid[0],&mid[0]+mid.size());
        sort(&low[0],&low[0]+low.size());
        int ma=0;
        for(int i=0;i<mid.size();i++){
            if(binary_search(high.begin(),high.end(),Data(0,mid[i].vx,mid[i].cx,mid[i].cy))||binary_search(low.begin(),low.end(),Data(0,-mid[i].vx,mid[i].cx,mid[i].cy)))ma=max(ma,men(mid[i]));
        }
        for(int i=0;i<high.size();i++){
            if(binary_search(low.begin(),low.end(),Data(high[i].vy,-high[i].vx,high[i].cx,high[i].cy)))ma=max(ma,men(high[i]));
        }
        printf("%d\n",ma);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:31: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'fisrt'; did you mean 'first'?
   44 |                 int tx=ins[i].fisrt-ins[j].first,ty=ins[i].second-ins[j].second;
      |                               ^~~~~
      |                               first
a.cc:48:26: error: 'ty' was not declared in this scope; did you mean 'tx'?
   48 |                     d.vy=ty;
      |                          ^~
      |                          tx
a.cc:51:27: error: 'ty' was not declared in this scope; did you mean 'tx'?
   51 |                     d.vy=-ty;
      |                           ^~
      |                           tx
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <bitset>
#include <fstream>
using namespace std;
typedef long long ll;

typedef pair<int,int> P;

vector<P> points;

bool checkSqr(P, P);
double distance(P, P);

int main()
{
	ifstream ifs("data.txt");
	int N;
	while(ifs>>N && N){
		points.clear();
		for(int i = 0; i < N; i++){
			P p;
			ifs>>p.first>>p.second;
			points.push_back(p);
		}
		sort(points.begin(), points.end());

		int res = 0;
		for(int i = 0; i < N; i++){
			for(int j = i+1; j < N; j++){
				P a = make_pair(points[i].first, points[i].second);
				P b = make_pair(points[j].first, points[j].second);
				if(checkSqr(a, b)){
					res = max(res, (int)(pow(distance(a,b), 2.0) / 2));
				}
			}
		}
		cout<<res<<endl;
	}
	cin.sync(); cin.get();
}
template<class T> T abs(T a)
{
	a < 0 ? -a : a;
}
double distance(P a, P b)
{
	return sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0));
}
bool checkSqr(P a, P b)
{
	P c, d;
	c.first = a.first + abs(b.second - a.second);
	c.second = a.second + abs(a.first - b.first);
	d.first = b.first + abs(a.second - a.second);
	d.second = b.second + abs(a.first - b.first);

	if(count(points.begin(), points.end(), c) && count(points.begin(), points.end(), d)) return true;
	else return true;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:62: error: 'pow' was not declared in this scope
   40 |                                         res = max(res, (int)(pow(distance(a,b), 2.0) / 2));
      |                                                              ^~~
a.cc: In function 'double distance(P, P)':
a.cc:54:21: error: 'pow' was not declared in this scope
   54 |         return sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0));
      |                     ^~~
a.cc:54:16: error: 'sqrt' was not declared in this scope
   54 |         return sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0));
      |                ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <bitset>
#include <fstream>
using namespace std;
typedef long long ll;

typedef pair<int,int> P;

vector<P> points;

bool checkSqr(P, P);
double dist(P, P);

int main()
{
	int N;
	while(cin>>N && N){
		points.clear();
		for(int i = 0; i < N; i++){
			P p;
			cin>>p.first>>p.second;
			points.push_back(p);
		}
		sort(points.begin(), points.end());

		int res = 0;
		for(int i = 0; i < N; i++){
			for(int j = i+1; j < N; j++){
				P a = points[i];
				P b = points[j];
				if(checkSqr(a, b))	res = max(res, (int)(pow(dist(a,b), 2.0)));
			}
		}
		cout<<res<<endl;
	}
}
double dist(P a, P b)
{
	return (double)(sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0)));
}
bool checkSqr(P a, P b)
{
	P c, d;
	c.first = a.first + abs(b.second - a.second);
	c.second = a.second + abs(a.first - b.first);
	d.first = b.first + abs(a.second - a.second);
	d.second = b.second + abs(a.first - b.first);

	if(count(points.begin(), points.end(), c) && count(points.begin(), points.end(), d)) return true;
	else return false;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:78: error: 'pow' was not declared in this scope
   38 |                                 if(checkSqr(a, b))      res = max(res, (int)(pow(dist(a,b), 2.0)));
      |                                                                              ^~~
a.cc: In function 'double dist(P, P)':
a.cc:46:30: error: 'pow' was not declared in this scope
   46 |         return (double)(sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0)));
      |                              ^~~
a.cc:46:25: error: 'sqrt' was not declared in this scope
   46 |         return (double)(sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0)));
      |                         ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <bitset>
#include <fstream>
using namespace std;
typedef long long ll;

typedef pair<int,int> P;

vector<P> points;

bool checkSqr(P, P);
double dist(P, P);

int main()
{
	int N;
	while(cin>>N && N){
		points.clear();
		for(int i = 0; i < N; i++){
			P p;
			cin>>p.first>>p.second;
			points.push_back(p);
		}
		sort(points.begin(), points.end());

		int res = 0;
		for(int i = 0; i < N; i++){
			for(int j = i+1; j < N; j++){
				P a = points[i];
				P b = points[j];
				if(checkSqr(a, b))	res = max(res, (int)(pow(dist(a,b), 2.0)));
			}
		}
		cout<<res<<endl;
	}
}
int abs(int a)
{
	return a < 0 ? -a : a;
}
double dist(P a, P b)
{
	return (double)(sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0)));
}
bool checkSqr(P a, P b)
{
	P c, d;
	c.first = a.first + abs(b.second - a.second);
	c.second = a.second + abs(a.first - b.first);
	d.first = b.first + abs(a.second - a.second);
	d.second = b.second + abs(a.first - b.first);

	if(count(points.begin(), points.end(), c) && count(points.begin(), points.end(), d)) return true;
	else return false;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:78: error: 'pow' was not declared in this scope
   38 |                                 if(checkSqr(a, b))      res = max(res, (int)(pow(dist(a,b), 2.0)));
      |                                                                              ^~~
a.cc: In function 'double dist(P, P)':
a.cc:50:30: error: 'pow' was not declared in this scope
   50 |         return (double)(sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0)));
      |                              ^~~
a.cc:50:25: error: 'sqrt' was not declared in this scope
   50 |         return (double)(sqrt(pow(abs(a.first-b.first),2.0)+pow(abs(a.second-b.second),2.0)));
      |                         ^~~~