/* -*- coding: utf-8 -*- * * 245.cc: No.245 貫け! - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100; const int MAX_N2 = MAX_N * 2; /* typedef */ typedef long long ll; template struct Pt { T x, y; Pt() {} Pt(T _x, T _y) : x(_x), y(_y) {} Pt(const Pt& pt) : x(pt.x), y(pt.y) {} bool operator==(const Pt pt) const { return x == pt.x && y == pt.y; } Pt operator+(const Pt pt) const { return Pt(x + pt.x, y + pt.y); } Pt operator-() const { return Pt(-x, -y); } Pt operator-(const Pt pt) const { return Pt(x - pt.x, y - pt.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; } }; typedef Pt pt; /* global variables */ pt pts[MAX_N * 2]; /* subroutines */ /* main */ int main() { int n; cin >> n; if (n == 1) { puts("1"); return 0; } int n2 = n * 2; for (int i = 0; i < n2; i++) cin >> pts[i].x >> pts[i].y; int maxc = 0; for (int i = 0; i < n2; i++) { pt &pi = pts[i]; for (int j = i + 1; j < n2; j++) { pt &pj = pts[j]; if (pi == pj) continue; pt v = pj - pi; int c = 0; for (int k = 0; k < n; k++) { pt &pk0 = pts[k * 2], &pk1 = pts[k * 2 + 1]; if (v.cross(pk0 - pi) * v.cross(pk1 - pi) <= 0) c++; } if (maxc < c) maxc = c; } } printf("%d\n", maxc); return 0; }