#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; #define EPS 1e-8 class V2{ public: double x, y; V2(){} V2(double x_, double y_):x(x_),y(y_){} bool operator<(const V2 &p) const{ return x!=p.x?x> N; A = B = C = D = vi(N); rep(i, N)cin >> A[i] >> B[i] >> C[i] >> D[i]; vector P; rep(i, N){ for(pii p : {mp(A[i], B[i]), mp(C[i], D[i])}) P.push_back(p); } sort(all(P)); P.erase(unique(all(P)), P.end()); int ans = min(2, N); rep(i, sz(P))FOR(j, i + 1, sz(P)){ int ax, ay, bx, by; tie(ax, ay) = P[i]; tie(bx, by) = P[j]; V2 S(ax, ay), T(bx, by); int tmp = 0; rep(k, N){ tmp += colLinSeg(S, T, V2(A[k], B[k]), V2(C[k], D[k])); } smax(ans, tmp); } cout << ans << endl; }