#include #include #include #include struct y { bool operator () (const std::pair & a, const std::pair & b) const { if (a.second > b.second) return true; return a.first < b.first; } }; struct x { bool operator () (const std::pair & a, const std::pair & b) const { if (a.first < b.first) return true; return a.second < b.second; } }; int main() { size_t n; std::cin >> n; std::set, x> xFirst; // vlevo dole std::set, y> yFirst; // vlevo nahore for (size_t i = 0; i < n; ++i) { long x, y; std::cin >> x >> y; xFirst.insert({x, y}); yFirst.insert({x, y}); } while (n != 4) { n -= 4; std::pair a; std::pair b; std::pair c; std::pair d; a = *xFirst.begin(); b = *yFirst.begin(); c = *(--xFirst.end()); d = *(--yFirst.end()); xFirst.erase(a); xFirst.erase(b); xFirst.erase(c); xFirst.erase(d); yFirst.erase(a); yFirst.erase(b); yFirst.erase(c); yFirst.erase(d); } std::pair a; std::pair b; std::pair c; std::pair d; a = *xFirst.begin(); b = *yFirst.begin(); c = *(--xFirst.end()); d = *(--yFirst.end()); long dx = abs(a.first - b.first); long dy = abs(a.second - b.second); double xxxx = std::sqrt(dx * dx + dy * dy); dx = abs(c.first - b.first); dy = abs(c.second - b.second); double yyyy = std::sqrt(dx * dx + dy * dy); std::cout << int(xxxx*yyyy) << std::endl; return 0; }