#include using namespace std; #define rep(i, a, b) for (int i=a;i<(b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair pii; typedef vector vi; typedef vector vvi; double dist(pii a, pii b) { return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)); } int main() { cin.tie(0)->sync_with_stdio(0); int N; cin >> N; vector UD(N); for(int i = 0; i < N; i++) cin >> UD[i].first >> UD[i].second; vector LR = UD; std::sort(all(UD), [](auto a, auto b) { if(a.first == b.first) return a.second < b.second; return a.first < b.first; }); std::sort(all(LR), [](auto a, auto b) { if (a.second == b.second) return a.first < b.second; return a.second < b.second; }); set seen; vector inner; int u = 0, d = UD.size() - 1, l = 0, r = LR.size() - 1; while (seen.size() < N) { inner.clear(); while(seen.count(UD[u])) u++; seen.insert(UD[u]); inner.push_back(UD[u]); while(seen.count(LR[l])) l++; seen.insert(LR[l]); inner.push_back(LR[l]); while(seen.count(UD[d])) d--; seen.insert(UD[d]); inner.push_back(UD[d]); while(seen.count(LR[r])) r--; seen.insert(LR[r]); inner.push_back(LR[r]); } std::sort(inner.begin(), inner.end(), [](pii a, pii b) { if(a.first == b.first) return a.second < b.second; return a.first < b.first; }); cout << int(dist(inner[0], inner[1]) * dist(inner[0], inner[2]) + 0.5) << endl; }