#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)); auto M{size(upper)}; for(unsigned long i{}; i < M; ++i)upper.emplace_back(upper[i]); long ans{}; for(unsigned long i{}, j{}; i < M; ++i){ while(j + 1 < 2 * M && upper[i].first * upper[j].second + upper[i].second * upper[j + 1].first > upper[i].second * upper[j].first + upper[i].first * upper[j + 1].second)++j; ans = max(ans, upper[i].second * upper[j].first - upper[i].first * upper[j].second); } cout << ans << endl; return 0; }