#include using namespace std; #define int long long int distSq(paira,pairb) { return (a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second); } signed main() { int n; cin >> n; deque> v(n), v2; for(auto&a:v)cin>>a.first>>a.second; v2 = v; sort(v.begin(), v.end()); sort(v2.begin(), v2.end(), [](pair a, pair b){ if(a.second == b.second) return a.first < b.first; return a.second < b.second; }); set> s; for(auto a: v) s.insert(a); while(s.size() > 4) { while(s.find(v.front()) == s.end()) v.pop_front(); s.erase(v.front()); v.pop_front(); while(s.find(v.back()) == s.end()) v.pop_back(); s.erase(v.back()); v.pop_back(); while(s.find(v2.front()) == s.end()) v2.pop_front(); s.erase(v2.front()); v2.pop_front(); while(s.find(v2.back()) == s.end()) v2.pop_back(); s.erase(v2.back()); v2.pop_back(); } vector> points; for(auto a:s) points.push_back(a); vector>> dists; for(int i = 0; i < 4; i++) for(int j = 0; j < i; j++) { dists.push_back({distSq(points[i], points[j]), {i,j}}); } sort(dists.begin(), dists.end()); auto pA = points[dists[0].second.first]; auto pB = points[dists[0].second.second]; auto pC = points[dists[2].second.first]; auto pD = points[dists[2].second.second]; pair p1{abs(pA.first - pB.first), abs(pA.second - pB.second)}; pair p2{abs(pC.first - pD.first), abs(pC.second - pD.second)}; int result = round(sqrtl(p1.first*p1.first + p1.second*p1.second) * sqrtl(p2.first*p2.first + p2.second*p2.second)); cout << result << '\n'; }