/* -*- coding: utf-8 -*- * * 1041.cc: No.1041 直線大学 - 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; /* typedef */ 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) {} 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; } 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); } void print() { printf("(%d,%d)", x, y); } }; typedef Pt pt; /* global variables */ pt ps[MAX_N]; /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d%d", &ps[i].x, &ps[i].y); int maxc = 0; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) { int c = 2; pt v(ps[j] - ps[i]); for (int k = j + 1; k < n; k++) if (v.cross(ps[k] - ps[j]) == 0) c++; if (maxc < c) maxc = c; } printf("%d\n", maxc); return 0; }