#include #include #include #include #include using namespace std ; int gcd(int a, int b) { if (b < a) return gcd(b, a) ; if (a == 0) return b ; return gcd(b % a, a) ; } struct line { line(int a_, int b_, long long c_) : a(a_), b(b_), c(c_) { if (a < 0 || (a == 0 && b < 0)) { a = -a ; b = -b ; c = -c ; } } int a, b ; long long c ; bool on(long long x, long long y) { return a*x + b*y == c ; } bool operator<(const line &line2) const { if (a != line2.a) return a < line2.a ; if (b != line2.b) return b < line2.b ; return c < line2.c ; } bool operator==(const line &line2) const { return a==line2.a && b==line2.b && c==line2.c ; } } ; struct lineinfo { lineinfo() : bisect(0), through(0), hasincident(0) {} int bisect, through, hasincident ; int score() { if (through) return 2 * bisect + 1 + (int)floor(sqrt(2*through)) ; else return 2 * bisect ; } int upside() { return through == 0 ; } } ; long long dist(long long x1, long long y1, long long x2, long long y2) { x1 -= x2 ; y1 -= y2 ; return x1 * x1 + y1 * y1 ; } int main(int argc, char *argv[]) { int n ; cin >> n ; vector xs, ys ; map lines ; for (int i=0; i> x >> y ; for (int j=0; j::iterator it = lines.begin(); it != lines.end(); it++) { lineinfo &li = it->second ; int t = li.score() ; if (t > best) { best = t ; maybebetter = li.upside() ; } else if (t == best && li.upside()) maybebetter = 1 ; } /* let's take a break and look at rotational symmetry */ map, int> pts ; for (int i=0; i, int>::iterator it = pts.begin(); it != pts.end(); it++) if (it->second > best) { best = it->second ; maybebetter = 0 ; } /* maybe we can do better. Scan for better bisectors. */ vector > dists ; int foundbetter = 0 ; for (int i=0; foundbetter == 0 && i