#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; typedef vector> vpii; template using vec = vector; template using uset = unordered_set; template using umap = unordered_map; void solve () { ll N; cin >> N; vpii xvec; vpii yvec; vpii stakes; rep(i, 0, N) { int X, Y; cin >> X >> Y; stakes.emplace_back(X , Y); xvec.emplace_back(X, i); yvec.emplace_back(Y, i); } std::sort(xvec.begin(), xvec.end()); std::sort(yvec.begin(), yvec.end()); double centerX = (xvec[N/2].first + xvec[(N/2) -1].first) /2.0; double centerY = (yvec[N/2].first + yvec[(N/2) -1].first) /2.0; vec> dist(N); rep(i, 0, N) { const auto & stake = stakes[i]; dist[i] ={ (stake.first - centerX) * (stake.first - centerX) + (stake.second - centerY) * (stake.second - centerY), i}; } std::sort(dist.begin(), dist.end()); auto a = stakes[dist[0].second]; auto b = stakes[dist[1].second]; auto c = stakes[dist[2].second]; auto d = stakes[dist[3].second]; double d1 = std::sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)); double d2 = std::sqrt((a.first - c.first) * (a.first - c.first) + (a.second - c.second) * (a.second - c.second)); double d3 = std::sqrt((a.first - d.first) * (a.first - d.first) + (a.second - d.second) * (a.second - d.second)); // double aDist = min(d1,d2); // double bDist = min(d1,d3); array dists = {d1, d2, d3}; std::sort(dist.begin(), dist.end()); ll area = ll(dists[0] * dists[1]); cout << area << endl; } int main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); ll T = 1; //cin >> T; rep(i, 0, T) solve(); return 0; }