#include using namespace std; using ll = long long; #define F first #define S second #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)(x).size() struct Point { int x, y; }; struct cmpX { bool operator()(Point a, Point b) const { return tie(a.x, a.y) < tie(b.x, b.y); } }; struct cmpY { bool operator()(Point a, Point b) const { return tie(a.y, a.x) < tie(b.y, b.x); } }; double dist (double x1, double y1, double x2, double y2) { return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); } void solve() { int n; cin >> n; set srtX; set srtY; for (int i = 0; i < n; i++) { Point p; cin >> p.x >> p.y; srtX.insert(p); srtY.insert(p); } while (sz(srtX) > 4) { Point mnY = *srtY.begin(); srtY.erase(mnY); srtX.erase(mnY); Point mxY = *prev(srtY.end()); srtY.erase(mxY); srtX.erase(mxY); Point mnX = *srtX.begin(); srtY.erase(mnX); srtX.erase(mnX); Point mxX = *prev(srtX.end()); srtY.erase(mxX); srtX.erase(mxX); } assert(srtX.size() == 4); auto p1 = *srtX.begin(); srtX.erase(srtX.begin()); auto p2 = *srtX.begin(); srtX.erase(srtX.begin()); auto p3 = *srtX.begin(); srtX.erase(srtX.begin()); auto p4 = *srtX.begin(); srtX.erase(srtX.begin()); // area = side 12 times side 13 int area = dist(p1.x, p1.y, p2.x, p2.y) * dist(p1.x, p1.y, p3.x, p3.y); cout << area << endl; } signed main() { solve(); }