#include #include #include #include #include #include #include using namespace std; using u64 = unsigned long long; struct pos { int x; int y; bool topLeft(const pos& other) const { if (x < other.x) { return true; } else if (x == other.x && y < other.y) { return true; } else { return false; } } bool topRight(const pos& other) const { if (y < other.y) { return true; } else if (y == other.y && x > other.x) { return true; } else { return false; } } bool bottomLeft(const pos& other) const { if (x > other.x) { return true; } else if (x == other.x && y > other.y) { return true; } else { return false; } } bool bottomRight(const pos& other) const { if (y > other.y) { return true; } else if (y == other.y && x < other.x) { return true; } else { return false; } } 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); } }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int nodes; cin >> nodes; list positions; for (int i = 0; i < nodes; ++i) { pos p; cin >> p.x >> p.y; positions.push_back(p); } int iter = nodes / 4; for (int i = 0; i < iter; ++i) { auto topLeft = positions.begin(); auto topRight = topLeft; auto bottomLeft = topLeft; auto bottomRight = topLeft; for (auto it = positions.begin(); it != positions.end(); ++it) { topLeft = topLeft->topLeft(*it) ? topLeft : it; topRight = topRight->topRight(*it) ? topRight : it; bottomLeft = bottomLeft->bottomLeft(*it) ? bottomLeft : it; bottomRight = bottomRight->bottomRight(*it) ? bottomRight : it; } 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); } }