#include <bits/stdc++.h>
using namespace std;
int generate_random() {
  const int MAX_RANDOM = (int)1e6;
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  return uniform_int_distribution<int>(0, MAX_RANDOM)(rng);
}
const long long INFLL = 2 * (long long)1e18 + 100;
const long long INFINT = INFLL;
const double PI = atan(1) * 4;
const double EPS = 1e-6;
const long long SEED = (long long)1e3 + 7;
const long long MOD = (long long)1e9 + 7;
const long long NMAX = (long long)1e6 + 5;
int32_t main() {
  srand(time(nullptr));
  cout << setprecision(20) << fixed;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  if (n == 1) return cout << 0, 0;
  vector<long long> v;
  for (long long i = 1; i <= n; i++) {
    long long a, b;
    cin >> a >> b;
    v.emplace_back(a);
    v.emplace_back(b);
  }
  sort(v.begin(), v.end());
  long long sol = v.back() - v[0];
  long long mmin = INFINT;
  for (long long i = 1; i + n - 1 < v.size() - 1; i++)
    mmin = min(mmin, v[i + n - 1] - v[i]);
  sol *= mmin;
  sol = min(sol, (v[v.size() / 2 - 1] - v[0]) * (v.back() - v[v.size() / 2]));
  for (long long i = 1; i + n - 1 < v.size() - 1; i++)
    sol = min(sol, (v[i + n - 1] - v[0]) * (v.back() - v[i]));
  cout << sol;
  return 0;
}
