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 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[ind[0]];
    Bmax = Bmin = y[ind[0]];
    FOR(k, 1, N){
        int i = ind[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]);
        }
    }
    ll ans = (Rmax-Rmin) * (Bmax-Bmin);
    sort(ind.begin(), ind.end(), [](int i, int j){
        return y[i] < y[j];
    });
    Rmax = Rmin = x[ind[0]];
    Bmax = Bmin = y[ind[0]];
    FOR(k, 1, N){
        int i = ind[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]);
        }
    }
    ans = min(ans, (Rmax-Rmin) * (Bmax-Bmin));
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: expected ',' or ';' before 'long'
   16 | #define ll         long long
      |                    ^~~~
a.cc:38:9: note: in expansion of macro 'll'
   38 |         ll comp1 = 0, comp2 = 0;
      |         ^~
a.cc:40:25: error: 'comp1' was not declared in this scope
   40 |         if(x[i] > Rmax) comp1 = x[i] - Rmin;
      |                         ^~~~~
a.cc:41:30: error: 'comp1' was not declared in this scope
   41 |         else if(x[i] < Rmin) comp1 = Rmax - x[i];
      |                              ^~~~~
a.cc:42:14: error: 'comp1' was not declared in this scope
   42 |         else comp1 = Rmax - Rmin;
      |              ^~~~~
a.cc:43:25: error: 'comp1' was not declared in this scope
   43 |         if(y[i] > Bmax) comp1 *= y[i] - Bmin;
      |                         ^~~~~
a.cc:44:30: error: 'comp1' was not declared in this scope
   44 |         else if(y[i] < Bmin) comp1 *= Bmax - y[i];
      |                              ^~~~~
a.cc:45:14: error: 'comp1' was not declared in this scope
   45 |         else comp1 *= Bmax - Bmin;
      |              ^~~~~
a.cc:47:25: error: 'comp2' was not declared in this scope
   47 |         if(y[i] > Rmax) comp2 = y[i] - Rmin;
      |                         ^~~~~
a.cc:48:30: error: 'comp2' was not declared in this scope
   48 |         else if(y[i] < Rmin) comp2 = Rmax - y[i];
      |                              ^~~~~
a.cc:49:14: error: 'comp2' was not declared in this scope
   49 |         else comp2 = Rmax - Rmin;
      |              ^~~~~
a.cc:50:25: error: 'comp2' was not declared in this scope
   50 |         if(x[i] > Bmax) comp2 *= x[i] - Bmin;
      |                         ^~~~~
a.cc:51:30: error: 'comp2' was not declared in this scope
   51 |         else if(x[i] < Bmin) comp2 *= Bmax - x[i];
      |                              ^~~~~
a.cc:52:14: error: 'comp2' was not declared in this scope
   52 |         else comp2 *= Bmax - Bmin;
      |              ^~~~~
a.cc:54:12: error: 'comp1' was not declared in this scope
   54 |         if(comp1<=comp2){
      |            ^~~~~
a.cc:54:19: error: 'comp2' was not declared in this scope
   54 |         if(comp1<=comp2){
      |                   ^~~~~