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>
using namespace std;

#define ll         long long
#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

//方針

ll llabs(ll x){
    return x>0?x:-x;
}
ll x[200000], y[200000];

int main(){
    int N;
    cin >> N;
    FOR(i, 0, N) cin >> x[i] >> y[i];
    vector<int> ind(N);
    FOR(i, 0, N) ind[i] = i;
    sort(ind.begin(), ind.end(), [](int i, int j){
        return x[i] < x[j];
    });
    ll Rmax, Rmin, Bmax, Bmin;
    Rmax = Rmin = x[idx[0]];
    Bmax = Bmin = y[idx[0]];
    FOR(k, 1, N){
        int i = idx[k]
        ll comp1 = 0, comp2 = 0;
        //xがRの時
        if(x[i] > Rmax) comp1 = x[i] - Rmin;
        else if(x[i] < Rmin) comp1 = Rmax - x[i];
        else comp1 = Rmax - Rmin;
        if(y[i] > Bmax) comp1 *= y[i] - Bmin;
        else if(y[i] < Bmin) comp1 *= Bmax - y[i];
        else comp1 *= Bmax - Bmin;

        if(y[i] > Rmax) comp2 = y[i] - Rmin;
        else if(y[i] < Rmin) comp2 = Rmax - y[i];
        else comp2 = Rmax - Rmin;
        if(x[i] > Bmax) comp2 *= x[i] - Bmin;
        else if(x[i] < Bmin) comp2 *= Bmax - x[i];
        else comp2 *= Bmax - Bmin;

        if(comp1<=comp2){
            Rmax = max(Rmax, x[i]);
            Rmin = min(Rmin, x[i]);
            Bmax = max(Bmax, y[i]);
            Bmin = min(Bmin, y[i]);
        }
        else{
            Rmax = max(Rmax, y[i]);
            Rmin = min(Rmin, y[i]);
            Bmax = max(Bmax, x[i]);
            Bmin = min(Bmin, x[i]);
        }
    }
    cout << (Rmax-Rmin) * (Bmax-Bmin) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:21: error: 'idx' was not declared in this scope
   37 |     Rmax = Rmin = x[idx[0]];
      |                     ^~~
a.cc:43:25: error: 'comp1' was not declared in this scope
   43 |         if(x[i] > Rmax) comp1 = x[i] - Rmin;
      |                         ^~~~~
a.cc:44:30: error: 'comp1' was not declared in this scope
   44 |         else if(x[i] < Rmin) comp1 = Rmax - x[i];
      |                              ^~~~~
a.cc:45:14: error: 'comp1' was not declared in this scope
   45 |         else comp1 = Rmax - Rmin;
      |              ^~~~~
a.cc:46:25: error: 'comp1' was not declared in this scope
   46 |         if(y[i] > Bmax) comp1 *= y[i] - Bmin;
      |                         ^~~~~
a.cc:47:30: error: 'comp1' was not declared in this scope
   47 |         else if(y[i] < Bmin) comp1 *= Bmax - y[i];
      |                              ^~~~~
a.cc:48:14: error: 'comp1' was not declared in this scope
   48 |         else comp1 *= Bmax - Bmin;
      |              ^~~~~
a.cc:50:25: error: 'comp2' was not declared in this scope
   50 |         if(y[i] > Rmax) comp2 = y[i] - Rmin;
      |                         ^~~~~
a.cc:51:30: error: 'comp2' was not declared in this scope
   51 |         else if(y[i] < Rmin) comp2 = Rmax - y[i];
      |                              ^~~~~
a.cc:52:14: error: 'comp2' was not declared in this scope
   52 |         else comp2 = Rmax - Rmin;
      |              ^~~~~
a.cc:53:25: error: 'comp2' was not declared in this scope
   53 |         if(x[i] > Bmax) comp2 *= x[i] - Bmin;
      |                         ^~~~~
a.cc:54:30: error: 'comp2' was not declared in this scope
   54 |         else if(x[i] < Bmin) comp2 *= Bmax - x[i];
      |                              ^~~~~
a.cc:55:14: error: 'comp2' was not declared in this scope
   55 |         else comp2 *= Bmax - Bmin;
      |              ^~~~~
a.cc:57:12: error: 'comp1' was not declared in this scope
   57 |         if(comp1<=comp2){
      |            ^~~~~
a.cc:57:19: error: 'comp2' was not declared in this scope
   57 |         if(comp1<=comp2){
      |                   ^~~~~