#include #include #include #include #include #include #include #include #include #include #include using namespace std; template struct point{ T x, y; }; //judge if line AB intersects line CD template bool intersect(point &a, point &b, point &c, point &d){ bool ans = 1; T s, t; s = (a.x - b.x) * (c.y - a.y) - (a.y - b.y) * (c.x - a.x); t = (a.x - b.x) * (d.y - a.y) - (a.y - b.y) * (d.x - a.x); if (s*t > 0) ans = 0; s = (c.x - d.x) * (a.y - c.y) - (c.y - d.y) * (a.x - c.x); t = (c.x - d.x) * (b.y - c.y) - (c.y - d.y) * (b.x - c.x); if (s*t > 0) ans = 0; return ans; } int main(){ long long N, mx=0, M, cnt; cin >> N; vector> c(N), d(N); for (int i=0; i> c[i].x >> c[i].y >> d[i].x >> d[i].y; vector> P; for (int i=-150; i<=150; i++){ P.push_back({150, i}); P.push_back({i, 150}); P.push_back({-150, i}); P.push_back({i, -150}); } M = P.size(); for (int i=0; i