#include #include #include #include using namespace std; struct orderX { bool operator () (const pair & lhs, const pair & rhs) const { return lhs.first < rhs.first || (lhs.first == rhs.first && lhs.second < rhs.second); } }; struct orderY { bool operator () (const pair & lhs, const pair & rhs) const { return lhs.second < rhs.second || (lhs.second == rhs.second && rhs.first < lhs.first); } }; int main() { int n; cin >> n; set,orderX> coordsX; set,orderY> coordsY; for(int i = 0; i < n; ++i) { int x, y; cin >> x >> y; coordsX.insert({x,y}); coordsY.insert({x,y}); } auto yFront = coordsY.begin(); auto yBack = --coordsY.end(); while(coordsX.size() > 4) { auto minX = *(coordsX.begin()); auto maxX = *(--coordsX.end()); coordsX.erase(coordsX.begin()); coordsX.erase(--coordsX.end()); coordsY.erase(minX); coordsY.erase(maxX); coordsX.erase(*(yFront++)); coordsX.erase(*(yBack--)); coordsY.erase(coordsY.begin()); coordsY.erase(--coordsY.end()); } // for(auto i : coordsX) { // cout << "[" << i.first << ", " << i.second << "]" << endl; // > } auto a = *coordsX.begin(), b = *(++coordsX.begin()), c = *(++(++coordsX.begin())); // for(auto i : {a, b, c}) { // cout << "[" << i.first << ", " << i.second << "]" << endl; // } cout << hypot(a.first - b.first, a.second - b.second) * hypot(c.first - a.first, c.second - a.second) << endl; return 0; }