#include #include #include #include #include #define FORR(i,b,e) for(int i=(b);i<(int)(e);++i) #define FOR(i,e) FORR(i,0,e) #define ALL(c) begin(c), end(c) #define sortuniq(v) sort(v.begin(), v.end()), v.erase(unique(v.begin(),v.end()),v.end()) #define dump(var) cerr << #var ": " << var << "\n" #define dumpc(con) for(auto& e: con) cerr << e << " "; cerr<<"\n" typedef long long ll; typedef unsigned long long ull; const double EPS = 1e-6; const int d4[] = {0, -1, 0, 1, 0}; using namespace std; struct Point { int x, y; }; int cross(int a, int b, int c, int d) { return a * d - b * c; } bool crossing(Point &a, Point &b, Point &c, Point&d) { return cross(b.x-a.x, b.y-a.y, c.x-a.x, c.y-a.y) * cross(b.x-a.x, b.y-a.y, d.x-a.x, d.y-a.y) <= 0; } Point p[105][2]; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; FOR(i, N) { cin >> p[i][0].x >> p[i][0].y >> p[i][1].x >> p[i][1].y; } if (N < 3) { cout << N << endl; return 0; } int max_count = 0; FOR(i, N) FOR(ii, 2) { Point &a = p[i][ii]; FORR(j, i+1, N) FOR(jj, 2) { Point &b = p[j][jj]; int cnt = 2; FOR(k, N) { if (k==i || k==j) continue; cnt += (int)crossing(a, b, p[k][0], p[k][1]); } // dump(cnt); max_count = max(max_count, cnt); } } cout << max_count << endl; return 0; }