#include #include #include #include #include #include #include #include #include #include using namespace std; typedef vector VI; typedef vector VVI; typedef vector VS; typedef pair PII; typedef long long LL; typedef unsigned long long ULL; typedef pair PIL; typedef vector VPII; typedef vector VPIL; #define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++) #define sort(c) sort((c).begin(),(c).end()) #define range(i,a,b) for(int i=(a); i < (b); i++) #define rep(i,n) range(i,0,n) #define MAX_INT 2147483647 int cross_prod(PII a, PII b, PII pi){ return ( (b.first - a.first) * (b.second - pi.second) - (b.second - a.second) * (a.first - pi.first) ); } int count(PII a, PII b, VPII ep1, VPII ep2, int N){ int num = 0; rep(i,N){ if (cross_prod(a,b,ep1[i]) * cross_prod(a,b,ep2[i]) <= 0) num += 1; } return num; } int main(){ int N, max_num = 1; VPII ep1, ep2, p; cin >> N; ep1.resize(N); ep2.resize(N); rep(i,N){ cin >> ep1[i].first >> ep1[i].second >> ep2[i].first >> ep2[i].second; p.push_back(ep1[i]); p.push_back(ep2[i]); } rep(i,2*N-1) range(j,i+1,2*N){ if (p[i] != p[j]) max_num = max(max_num, count(p[i],p[j],ep1,ep2, N)); } cout << max_num << endl; return 0; }