#include #include #include #include #include #include using namespace std; using u64 = unsigned long long; struct pos { int x; int y; const pos& topLeft(const pos& other) const { if (x < other.x) { return *this; } else if (x == other.x && y < other.y) { return *this; } else { return other; } } const pos& topRight(const pos& other) const { if (y < other.y) { return *this; } else if (y == other.y && x > other.x) { return *this; } else { return other; } } const pos& bottomLeft(const pos& other) const { if (x > other.x) { return *this; } else if (x == other.x && y > other.y) { return *this; } else { return other; } } const pos& bottomRight(const pos& other) const { if (y > other.y) { return *this; } else if (y == other.y && x < other.x) { return *this; } else { return other; } } friend bool operator==(const pos &lhs, const pos &rhs) { return lhs.x == rhs.x && lhs.y == rhs.y; } friend bool operator!=(const pos &lhs, const pos &rhs) { return !(lhs == rhs); } pos operator-(const pos& other) const { return pos{x - other.x, y - other.y}; } double length() const { return hypot(x, y); } }; template <> struct std::hash { size_t operator()(const pos& pos) const noexcept { std::size_t seed = 0x391FBD9A; seed ^= (seed << 6) + (seed >> 2) + 0x50C83EE1 + static_cast(pos.x); seed ^= (seed << 6) + (seed >> 2) + 0x286DD840 + static_cast(pos.y); return seed; } }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int nodes; cin >> nodes; unordered_set positions; for (int i = 0; i < nodes; ++i) { pos p; cin >> p.x >> p.y; positions.insert(p); } int iter = nodes / 4; for (int i = 0; i < iter; ++i) { const pos* topLeft = &(*positions.begin()); const pos* topRight = topLeft; const pos* bottomLeft = topLeft; const pos* bottomRight = topLeft; for (const pos& p : positions) { topLeft = &topLeft->topLeft(p); topRight = &topRight->topRight(p); bottomLeft = &bottomLeft->bottomLeft(p); bottomRight = &bottomRight->bottomRight(p); } if (i == iter-1) { double area = (*topLeft - *topRight).length() * (*bottomLeft - *topRight).length(); int areaInt = (int)round(area); printf("%d\n", areaInt); return 0; } positions.erase(*topLeft); positions.erase(*topRight); positions.erase(*bottomLeft); positions.erase(*bottomRight); } }