#pragma region template #include using namespace std; // clang-format off using ll = long long; using vl = vector; using vvl = vector; using ld = long double; using vld = vector; using vvld = vector; using pll = pair; using vpll = vector; using vvpll = vector; using vb = vector; using vvb = vector>; using vs = vector; using mll = map; template using V = vector; template using VV = V>; template using VVV = V>; template using max_heap = priority_queue; template using min_heap = priority_queue, greater>; constexpr ll inf = 3001001000100100100LL; #define endl '\n' #define _overload(_1, _2, _3, name, ...) name #define rep(...) _overload(__VA_ARGS__, _rep, _rep2,)(__VA_ARGS__) #define repc(...) _overload(__VA_ARGS__, _repc, _repc2,)(__VA_ARGS__) #define repr(...) _overload(__VA_ARGS__, _repr, _repr2,)(__VA_ARGS__) #define reprc(...) _overload(__VA_ARGS__, _reprc, _reprc2,)(__VA_ARGS__) #define _rep(i,k,n) for(ll i=(k) , i##_xxxx=(n); i < i##_xxxx; ++i) #define _repc(i,k,n) for(ll i=(k) , i##_xxxx=(n); i <=i##_xxxx; ++i) #define _repr(i,k,n) for(ll i=(n)-1, i##_xxxx=(k); i >=i##_xxxx; --i) #define _reprc(i,k,n) for(ll i=(n) , i##_xxxx=(k); i >=i##_xxxx; --i) #define _rep2(i,n) _rep(i,0,n) #define _repc2(i,n) _repc(i,1,n) #define _repr2(i,n) _repr(i,0,n) #define _reprc2(i,n) _reprc(i,1,n) #define rall(o) rbegin(o), rend(o) #define all(o) begin(o), end(o) template ll sz(const C& c) { return static_cast(c.size()); } template bool chmax(T& m, const T& v){ if (m < v){ m = v; return true; } return false; } template bool chmin(T& m, const T& v){ if (v < m){ m = v; return true; } return false; } template T cdiv(const T& a, const T& b){ return (a + b - 1) / b; } template T rdiv(const T& a, const T& b){ return (a + b / 2) / b; } template string join(const T& v, const S& sep ){ stringstream ss; bool f = false; for (const auto& e : v){ if (f) ss << sep; f = true; ss << e;} return ss.str(); } template string join(const T& v, const S& sep, const U& ...args){ stringstream ss; bool f = false; for (const auto& c : v){ if (f) ss << sep; f = true; ss << join(c, args...); } return ss.str(); } template ostream& operator<<(ostream& os, const vector& seq){ os << '[' << join(seq, ",") << ']'; return os; } template ostream& operator<<(ostream& os, const vector>& seq){ os << '[' << join(seq, ",\n ") << ']'; return os; } template ostream& operator<<(ostream& os, const deque& seq){ os << '[' << join(seq, ",") << ']'; return os; } template ostream& operator<<(ostream& os, const set& seq){ os << '{' << join(seq, ",") << '}'; return os; } template ostream& operator<<(ostream& os, const unordered_set& seq){ os << '{' << join(seq, ",") << '}'; return os; } template ostream& operator<<(ostream& os, const map& seq){ os << '{'; bool f = false; for (const auto& e : seq){ if (f) os << ','; f = true; os << e.first << ":" << e.second; } os << '}'; return os; } template ostream& operator<<(ostream& os, const pair& pa){ os << '(' << pa.first << ',' << pa.second << ')'; return os; } #if LOCAL #define debug(...) _debug(__VA_ARGS__, __LINE__) #else #define debug(...) #endif void print() { std::cout << '\n'; } template void print(const S& a){ std::cout << a << '\n'; } template void _debug(const S& a){ std::cerr << "(L:" << std::setw(3) << a << ")\n"; } template void print(const S& a, const T&... args){ std::cout << a << ' '; print(args...); } template void _debug(const S& a, const T&... args){ std::cerr << a << ' '; _debug(args...); } struct setup_main { setup_main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); std::cout << fixed << setprecision(15); } } setup_main_; // clang-format on #pragma endregion template struct Point { T x, y; bool operator<(const Point& b) const { return x < b.x or (x == b.x and y < b.y); } Point operator-() const { return Point{-x, -y}; } Point operator+() const { return *this; } Point& operator+=(const Point& b) { x += b.x, y += b.y; return *this; } Point& operator-=(const Point& b) { x -= b.x, y -= b.y; return *this; } Point& operator*=(const T& c) { x *= c, y *= c; return *this; } friend Point operator+(const Point& a, const Point& b) { return Point(a) += b; } friend Point operator-(const Point& a, const Point& b) { return Point(a) -= b; } friend Point operator*(const Point& a, const Point& b) { return Point(a) -= b; } T cross(const Point& b) const { return (x * b.y - b.x * y); } friend T cross(const Point& a, const Point& b) { return a.cross(b); } friend ostream& operator<<(ostream& os, const Point& p) { os << make_pair(p.x, p.y); return os; } }; // 凸包 template vector> convex_calc(vector>& P) { vector> S; for (auto&& p1 : P) { while (sz(S) >= 2) { Point p2 = S.back(); S.pop_back(); Point p3 = S.back(); if (cross(p2 - p1, p3 - p2) < 0) { S.push_back(p2); break; } } S.push_back(p1); } return S; } template vector> convex_hull_upper(vector> P) { sort(all(P)); return convex_calc(P); } template vector> convex_hull_lower(vector> P) { sort(rall(P)); return convex_calc(P); } template vector> convex_hull(vector> P) { sort(all(P)); vector> u = convex_calc(P); reverse(all(P)); vector> l = convex_calc(P); rep(i, 1, l.size() - 1) u.push_back(l[i]); return u; } /*/ 凸包上の点だけ考えれば良い 底辺を決め打って、高さを3分探索 倍加すると探索が楽 /*/ void solve(ll N, vector X, vector Y) { vector> P(N); rep(i, N) P[i] = {X[i], Y[i]}; rep(i, N) P.push_back(-P[i]); P = convex_hull(P); ll ans = 0; N = sz(P) / 2; rep(i, N) { Point p = P[i]; auto f = [&](Point pl, Point pr) { return abs(cross(p, pl)) < abs(cross(p, pr)); }; ll l = i, r = i + N; while (r - l > 2) { ll ml = l + (r - l) / 3, mr = r - (r - l) / 3; if (f(P[ml], P[mr])) l = ml; else r = mr; } chmax(ans, abs(cross(p, P[l]))); chmax(ans, abs(cross(p, P[(r + l) / 2]))); chmax(ans, abs(cross(p, P[r]))); } print(ans); } int main() { int N; cin >> N; vector x(N), y(N); rep(i, N) { cin >> x[i] >> y[i]; } solve(N, x, y); }