#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using Int = long long; template ostream &operator<<(ostream &os, const pair &a) { return os << "(" << a.first << ", " << a.second << ")"; }; template ostream &operator<<(ostream &os, const vector &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; } template void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; } template bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; } template bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; } #define COLOR(s) ("\x1b[" s "m") inline int sig(Int r) { return (r < 0) ? -1 : (r > 0) ? +1 : 0; } inline Int sq(Int r) { return r * r; } struct Pt { Int x, y; Pt() : x(0), y(0) {} Pt(Int x_, Int y_) : x(x_), y(y_) {} Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); } Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); } Pt operator*(const Pt &a) const { return Pt(x * a.x - y * a.y, x * a.y + y * a.x); } Pt operator+() const { return Pt(+x, +y); } Pt operator-() const { return Pt(-x, -y); } Pt operator*(const Int &k) const { return Pt(x * k, y * k); } Pt operator/(const Int &k) const { return Pt(x / k, y / k); } friend Pt operator*(const Int &k, const Pt &a) { return Pt(k * a.x, k * a.y); } Pt &operator+=(const Pt &a) { x += a.x; y += a.y; return *this; } Pt &operator-=(const Pt &a) { x -= a.x; y -= a.y; return *this; } Pt &operator*=(const Pt &a) { return *this = *this * a; } Pt &operator*=(const Int &k) { x *= k; y *= k; return *this; } Int abs2() const { return x * x + y * y; } Int dot(const Pt &a) const { return x * a.x + y * a.y; } Int det(const Pt &a) const { return x * a.y - y * a.x; } bool operator==(const Pt &a) const { return (x == a.x && y == a.y); } bool operator<(const Pt &a) const { return ((x != a.x) ? (x < a.x) : (y < a.y)); } friend ostream &operator<<(ostream &os, const Pt &a) { os << "(" << a.x << ", " << a.y << ")"; return os; } }; inline Int tri(const Pt &a, const Pt &b, const Pt &c) { return (b - a).det(c - a); } // Watch out for the case a == b. int iSP(const Pt &a, const Pt &b, const Pt &c) { int s = sig((b - a).det(c - a)); if (s) return s; if (sig((b - a).dot(c - a)) < 0) return -2; // c-a-b if (sig((a - b).dot(c - b)) < 0) return +2; // a-b-c return 0; } int Q; vector P; Int mat[200'010][4]; int main() { for (; ~scanf("%d", &Q); ) { P.resize(3 + Q); for (int i = 0; i < 3 + Q; ++i) { int x, y; scanf("%d%d", &x, &y); P[i] = Pt(2 * x, 2 * y); } cerr<<"P = "<