Language: C++

#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>
#define typeof(x) __typeof__(x)
#define int long long int
#define mod(x) ((x % MOD) + MOD) % MOD
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);--i)

#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SZ(c) (int)((c).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define LB(c,x) (int)(lower_bound(ALL(c),x)-(c).begin())
#define UB(c,x) (int)(upper_bound(ALL(c),x)-(c).begin())
#define COUNT(c,x) UB(c,x)-LB(c,x)
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define PB push_back
#define MP make_pair
#define vec vector

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

using namespace std;

typedef pair<int,int> P;
struct edge {
  int to, cost;
};

const int INF = 1e18;
const int MOD = 1e9+7;

template<typename T> ostream& operator << (ostream& s, const vector<T>& v) {
  int len = v.size();
  s << "[";
  for (int i = 0; i < len; i++) {
    s << v[i]; if (i < len - 1) s << " ";
  }
  s << "]";
  return s;
}


signed main()
{
  int N; cin >> N;
  vec<int> x(N), y(N);
  int maximum = 1, minimum = 1e9;
  int max_count = 0, min_count = 0;
  int max_i = -1, min_i = -1;
  rep(i, 0, N) {
    cin >> x[i] >> y[i];
    if (maximum < max(x[i], y[i])) {
      maximum = max(x[i], y[i]);
      max_i = i;
      max_count = 1;
    } else if (maximum == max(x[i], y[i])) {
      max_count++;
    }
    if (minimum > min(x[i], y[i])) {
      minimum = min(x[i], y[i]);
      min_i = i;
      min_count = 1;
    } else if (minimum == min(x[i], y[i])) {
      min_count++;
    }
  }

  int minimax[2] = {1,1}, maxmini[2] = {1e9,1e9};
  rep(i, 0, N) {
    if (i == max_i && i == min_i) {
      continue;
    } else if (i == max_i) {
      minimax[0] = max(minimax[0], min(x[i], y[i]));
      maxmini[0] = min(maxmini[0], min(x[i], y[i]));
    } else if (i == min_i) {
      minimax[0] = max(minimax[0], max(x[i], y[i]));
      maxmini[0] = min(maxmini[0], max(x[i], y[i]));
    } else {
      minimax[0] = max(minimax[0], min(x[i], y[i]));
      maxmini[0] = min(maxmini[0], max(x[i], y[i]));
    }
  }
  rep(i, 0, N) {
    minimax[1] = max(minimax[1], min(x[i], y[i]));
    maxmini[1] = min(maxmini[1], max(x[i], y[i]));
  }

  cout << min((minimax[1] - minimum)*(maximum - maxmini[1]), (maximum - minimum)*(minimax[0] - maxmini[0])) << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:85:41: error: narrowing conversion of '1.0e+9' from 'double' to 'long long int' [-Wnarrowing]
   85 |   int minimax[2] = {1,1}, maxmini[2] = {1e9,1e9};
      |                                         ^~~
a.cc:85:45: error: narrowing conversion of '1.0e+9' from 'double' to 'long long int' [-Wnarrowing]
   85 |   int minimax[2] = {1,1}, maxmini[2] = {1e9,1e9};
      |                                             ^~~