#include int main(){ using namespace std; unsigned long N; cin >> N; vector> points(N); for(auto&& [x, y] : points)cin >> x >> y; sort(begin(points), end(points)); const auto cross_product{[](auto&& i, auto&& j, auto&& k){ auto&& [x0, y0]{i}; auto&& [x1, y1]{j}; auto&& [x2, y2]{k}; const auto a{x0 * y1 + x1 * y2 + x2 * y0}, b{x0 * y2 + x1 * y0 + x2 * y1}; return (a < b) - (a > b); }}; vector> upper, lower; for(const auto& now : points){ while(size(upper) > 1 && cross_product(upper.end()[-2], upper.end()[-1], now) < 0)upper.pop_back(); upper.emplace_back(now); } for(const auto& now : points){ while(size(lower) > 1 && cross_product(lower.end()[-2], lower.end()[-1], now) > 0)lower.pop_back(); lower.emplace_back(now); } reverse(begin(lower), end(lower)); if(upper.front() == lower.back())lower.pop_back(); if(lower.front() == upper.back())upper.pop_back(); upper.insert(end(upper), begin(lower), end(lower)); long ans{}; for(const auto& [x, y] : upper)for(const auto& [z, w] : upper)ans = max(ans, x * w - y * z); cout << ans << endl; return 0; }