Language: C++

#include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define pii pair<int,int>
#define ti3 tuple<int,int,int>
ll int MOD=998244353;
int INF=1e6;
 
using namespace std;
string alphabet("abcdefghijklmnopqrstuvwxyz");
 
 
main(){
    int n,a,b;
    cin>>n>>a>>b;
    int x[110000],y[110000];
    rep2(i,1,n){
        scanf("%d %d",&x[i],&y[i]);
    }
    pii sum[110000]={},dif[110000]={};
    rep2(i,1,n){
        sum[i-1].first=x[i]+y[i]; sum[i-1].second=i;
        dif[i-1].first=x[i]-y[i]; dif[i-1].second=i;
    }
    sort(sum,sum+n);
    sort(dif,dif+n);
    int flag[110000]={};
    flag[a]=flag[b]=1;
    queue<int> q;
    q.push(a); q.push(b);
    int r=abs(x[a]-x[b])+abs(y[a]-y[b]);
    int ans=0;
    while(!q.empty()){
        int t=q.front();
        q.pop();
        //右上
        int temp=x[t]+y[t]+r;
        int l=lower_bound(sum,sum+n,make_pair(temp,0))-sum;
        int rr=lower_bound(sum,sum+n,make_pair(temp,110000))-sum;
        int m=x[t]+r;
        rep2(i,l,rr-1){
            if(sum[i].first==temp&&x[t]<x[sum[i].second]&&x[sum[i].second]<=m) {
                if(flag[sum[i].second])
                else {flag[sum[i].second]=1; q.push(sum[i].second);}
            }
        }
        //左下
        temp-=2*r;
        m=x[t]-r;
        l=lower_bound(sum,sum+n,make_pair(temp,0))-sum;
        rr=lower_bound(sum,sum+n,make_pair(temp,110000))-sum;
        rep2(i,l,rr-1){          
            if(sum[i].first==temp&&x[t]>x[sum[i].second]&&x[sum[i].second]>=m) {
                if(flag[sum[i].second]) 
                else { flag[sum[i].second]=1; q.push(sum[i].second);}
            }
        }
        //左上
        temp=x[t]-y[t];
        temp-=r;
        m=y[t]+r;
        l=lower_bound(dif,dif+n,make_pair(temp,0))-dif;
        rr=lower_bound(dif,dif+n,make_pair(temp,110000))-dif;
        rep2(i,l,rr-1){
          
            if(dif[i].first==temp&&y[t]<y[dif[i].second]&&y[dif[i].second]<=m) {
                if(flag[dif[i].second]) 
                else { flag[dif[i].second]=1; q.push(dif[i].second);}
            }
        }
      //右下
        temp+=r*2;
        m=y[t]-r;
        l=lower_bound(dif,dif+n,make_pair(temp,0))-dif;
        rr=lower_bound(dif,dif+n,make_pair(temp,110000))-dif;
        rep2(i,l,rr-1){          
            if(dif[i].first==temp&&y[t]>y[dif[i].second]&&
            y[dif[i].second]>=m) {
                if(flag[dif[i].second]) 
                else {  flag[dif[i].second]=1; q.push(dif[i].second);}
            }
        }
    }
    cout<<ans/2;
    return 0;
}

Compiler output:
a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:45:17: error: expected primary-expression before 'else'
   45 |                 else {flag[sum[i].second]=1; q.push(sum[i].second);}
      |                 ^~~~
a.cc:56:17: error: expected primary-expression before 'else'
   56 |                 else { flag[sum[i].second]=1; q.push(sum[i].second);}
      |                 ^~~~
a.cc:69:17: error: expected primary-expression before 'else'
   69 |                 else { flag[dif[i].second]=1; q.push(dif[i].second);}
      |                 ^~~~
a.cc:81:17: error: expected primary-expression before 'else'
   81 |                 else {  flag[dif[i].second]=1; q.push(dif[i].second);}
      |                 ^~~~