#include <bits/stdc++.h>
#define int long long
using namespace std;
const int inf = 1e18;
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    map<int, int> o, v;
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int a, b;
        cin >> a >> b;
        o[a], v[b];
    }
    int mo = -inf, mv = -inf;
    int ult = inf;
    if (o.size() == 1 || v.size() == 1) {
        cout << -1;
        return 0;
    }
    for (auto [a, pula] : o) {
        mo = max(mo, a - ult);
        ult = a;
    }
    ult = inf;
    for (auto [a, pula] : o) {
        mv = max(mv, a - ult);
        ult = a;
    }
    cout << mo * mv;
    return 0;
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |