#include #include #include using namespace std; int main() { int N = 200000; int xcs[N], ycs[N]; set> stakes; int t; cin >> t; for (int i = 0; i < t; i++) { int x, y; cin >> x >> y; xcs[i] = x; ycs[i] = y; stakes.insert(make_pair(x, y)); } sort(xcs, xcs + t); sort(ycs, ycs + t); int expos = 1; int exposshift = 0; for (int i = 0; i < t/4 - 1; i++) { int xmin = xcs[expos - 1]; int xmax = xcs[t - expos]; int ymin = ycs[expos - 1]; int ymax = ycs[t - expos]; set> toDiscard; for (auto x : stakes) { int sumflg = (xmin == x.first) + (xmax == x.first) + (ymin == x.second) + (ymax == x.second); if (sumflg) { toDiscard.insert(x); exposshift = sumflg; } } expos += exposshift; for (auto y : toDiscard) { stakes.erase(y); } } pair ors[4]; int i = 0; for (auto x : stakes) { ors[i++] = x; } int a, b, c, d; a = ors[1].first - ors[0].first; b = ors[1].second - ors[0].second; c = ors[2].first - ors[0].first; d = ors[2].second - ors[0].second; cout << abs(a * d - b * c) << endl; }