/* -*- coding: utf-8 -*- * * 2331.cc: No.2331 Maximum Quadrilateral - yukicoder */ #include #include #include using namespace std; /* constant */ /* typedef */ template struct Pt { T x, y; Pt() {} Pt(T _x, T _y) : x(_x), y(_y) {} Pt(const Pt &p) : x(p.x), y(p.y) {} Pt operator+(const Pt p) const { return Pt(x + p.x, y + p.y); } Pt operator-() const { return Pt(-x, -y); } Pt operator-(const Pt p) const { return Pt(x - p.x, y - p.y); } Pt operator*(T t) const { return Pt(x * t, y * t); } Pt operator/(T t) const { return Pt(x / t, y / t); } T dot(Pt v) const { return x * v.x + y * v.y; } T cross(Pt v) const { return x * v.y - y * v.x; } Pt mid(const Pt p) { return Pt((x + p.x) / 2, (y + p.y) / 2); } T d2() { return x * x + y * y; } double d() { return sqrt(d2()); } bool operator==(const Pt pt) const { return x == pt.x && y == pt.y; } bool operator<(const Pt &pt) const { return x < pt.x || (x == pt.x && y < pt.y); } }; typedef Pt pt; typedef vector vpt; /* global variables */ /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); vpt ps(n); for (int i = 0; i < n; i++) scanf("%d%d", &ps[i].x, &ps[i].y); int maxs = 0; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) { pt v(ps[j] - ps[i]); int s0 = 0, s1 = 0; for (int k = 0; k < n; k++) if (k != i && k != j) { int s = v.cross(ps[k] - ps[i]); if (s > 0) s0 = max(s0, s); else if (s < 0) s1 = min(s1, s); } if (s0 > 0 && s1 < 0) maxs = max(maxs, s0 - s1); } printf("%d\n", maxs); return 0; }