#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; class Point { public: int y, x; Point(){ y = x = 0; } Point(int y0, int x0){ y = y0; x = x0; } Point operator+(const Point& p) const{ return Point(y + p.y, x + p.x); } Point operator-(const Point& p) const{ return Point(y - p.y, x - p.x); } Point operator*(int a) const{ return Point(y * a, x * a); } long long length2() const{ return y * (long long)y + x * (long long)x; } long long dist2(const Point& p) const{ return (y - p.y) * (long long)(y - p.y) + (x - p.x) * (long long)(x - p.x); } long long dot(const Point& p) const{ return y * (long long)p.y + x * (long long)p.x; // |a|*|b|*cosθ } long long cross(const Point& p) const{ return x * (long long)p.y - y * (long long)p.x; // |a|*|b|*sinθ } bool operator==(const Point& p) const{ return x == p.x && y == p.y; } }; bool segmentsCollide(const Point& a1, const Point& a2, const Point& b1, const Point& b2) { if(min(a1.x, a2.x) > max(b1.x, b2.x) || min(b1.x, b2.x) > max(a1.x, a2.x) || min(a1.y, a2.y) > max(b1.y, b2.y) || min(b1.y, b2.y) > max(a1.y, a2.y)) return false; long long c = (a2-a1).cross(b1-a1); long long d = (a2-a1).cross(b2-a1); long long e = (b2-b1).cross(a1-b1); long long f = (b2-b1).cross(a2-b1); return (c == 0 || d == 0 || ((c < 0) ^ (d < 0))) && (e == 0 || f == 0 || ((e < 0) ^ (f < 0))); } int main() { int n; cin >> n; vector > p(n, vector(2)); for(int i=0; i> p[i][j].y >> p[i][j].x; } } int ans = 0; for(int i=0; i