#include #include const int INF = (1 << 29); typedef std::uint_fast32_t u32; typedef std::int_fast32_t s32; typedef std::uint_fast64_t u64; template inline std::istream& operator >> (std::istream& is, std::complex& C) { T R, I; std::cin >> R >> I; C = std::complex(R, I); return is; } template class n32 { double EPS_ = 0.000001; public: int operator () (std::complex L1, std::complex L2, std::complex P) { if( ((P - L1) * conj(L2 - L1)).imag() > EPS_ ) return 1; else if( ((P - L1) * conj(L2 - L1)).imag() < -EPS_ ) return -1; return 0; } }; n32 up_and_down_decision; template class n33 { n32 up_and_down_decision_; public: bool operator () (std::complex P1, std::complex P2, std::complex P3, std::complex P4) { return ( up_and_down_decision_(P1, P2, P3) * up_and_down_decision_(P1, P2, P4) <= 0 and up_and_down_decision_(P3, P4, P1) * up_and_down_decision_(P3, P4, P2) <= 0 ); } }; n33 is_intersected; int main() { int n; std::complex P1[128], P2[128]; std::complex Pall[256]; std::cin >> n; for(int i = 0; i < n; ++i) { std::cin >> P1[i] >> P2[i]; Pall[i * 2] = P1[i]; Pall[i * 2 + 1] = P2[i]; } int res = 0; for(int i = 0; i < 2 * n; ++i) { for(int j = i + 1; j < 2 * n; ++j) { int count = 0; for(int k = 0; k < n; ++k) { if( is_intersected(Pall[i], Pall[j], P1[k], P2[k]) ) count += 1; } res = std::max(res, count); } } std::cout << res << std::endl; return 0; };