#define _USE_MATH_DEFINES #include #include #include #include #include //#include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; ///////// using namespace::std; ///////// int N; int a[100],b[100],c[100],d[100]; int AA,BB,CC; int ans = 0,tans; void setP(int A,int B,int C,int D){ AA = D-B; BB = A-C; CC = (A-C)*B+(D-B)*A; return; } int solve(){ int ans = 0; int s,t,D; double X,Y; tans = 0; rep(i,N){ s = (c[i]-a[i])*(a[i]*d[i]-b[i]*c[i]); t = CC; D = (d[i]-b[i])*BB-(a[i]-c[i])*AA; if(AA==0 && BB == 0){ } else if( AA == 0){ Y = CC;///BB; if( (BB*b[i] <= Y && Y <= BB*d[i])||(BB*d[i] <= Y && Y <= BB*b[i]) ){ ++tans; } }else if( BB == 0){ X = CC;///AA; if( (AA*a[i] <= X && X <= AA*c[i] ) || (AA*c[i] <= X && X <= AA*a[i]) ){ ++tans; } } else if( D == 0){ if(a[i]==c[i]){ //x=a[i] Y = (CC-AA*a[i]);///BB; if( (BB*b[i] <= Y && BB*d[i] <= Y) || (BB*d[i] <= Y && Y <= BB*b[i]) ){ ++tans; } }else if(b[i]==d[i]){ //y=b[i] X = (CC-BB*b[i]);///AA; if( (AA*a[i] <= X && X <= AA*c[i]) || (AA*c[i] <= X && X <= AA*a[i]) ){ ++tans; } }else{ if( (d[i]-b[i] == AA && a[i]-c[i] == BB && CC == (c[i]-a[i])*(a[i]*d[i]-b[i]*c[i]) )|| (d[i]-b[i] == -AA && a[i]-c[i] == -BB && -CC == (c[i]-a[i])*(a[i]*d[i]-b[i]*c[i]) ) ){ ++tans; } } }else{ X = s*BB-(a[i]-c[i])*t; Y = (d[i]-b[i])*t-s*AA; //X /= D; //Y /= D; if( ( (D*a[i] <= X && X <= D*c[i]) && (D*b[i] <= Y && Y <= D*d[i]) ) || ( (D*c[i] <= X && X <= D*a[i]) && (D*d[i] <= Y && Y <= D*b[i]) ) ){ ++tans; } } } ans = max(ans,tans); return ans; } int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(10);// cin>>N; rep(i,N){ cin>>a[i]>>b[i]>>c[i]>>d[i]; } int ANS=0,temp; for(int i=0;i