// thetta er ekki nogu nakvaemt!!!!!! #include #include #include #include #include #define EPS 1e-9 #define rep(E, F) for (E = 0; E < (F); E++) int min(int a, int b) { if (a > b) return b; return a; } int max(int a, int b) { if (a < b) return b; return a; } int get_int(); typedef double complex pt; int ccw(pt a, pt b, pt c) { if (cabs(a - b) < EPS || fabs(cimag((c - a)/(b - a))) < EPS) return 0; return cimag((c - a)/(b - a)) > 0.0 ? 1 : -1; } pt piv; int cmp(const void* p1, const void* p2) { pt a = *(pt*)p1, b = *(pt*)p2; if (fabs(carg(a - piv) - carg(b - piv)) > EPS) return carg(a - piv) < carg(b - piv) ? -1 : 1; if (fabs(cabs(a - piv) - cabs(b - piv)) < EPS) return 0; return cabs(a - piv) < cabs(b - piv) ? -1 : 1; } int convex_hull(pt* p, pt* h, int n) { int j = 0, i, mn = 0; for (i = 1; i < n; i++) if (cimag(p[i]) < cimag(p[mn]) || cimag(p[i]) == cimag(p[mn]) && creal(p[i]) < creal(p[mn])) mn = i; pt t = p[mn]; p[mn] = p[0]; p[0] = t; piv = p[0]; qsort(p + 1, n - 1, sizeof(p[1]), cmp); for (i = 1; i < n && cabs(p[0] - p[i]) < EPS; i++); if (i == n) h[j++] = p[0]; else if (i == n - 1) h[j++] = p[0], h[j++] = p[n - 1]; if (i >= n - 1) return j; h[j++] = p[n - 1], h[j++] = p[0], h[j++] = p[i]; if (ccw(h[0], h[1], h[2]) == 0) return j - (cabs(h[0] - h[1]) < EPS ? 2 : 1); for (i++; i < n;) (cabs(h[j - 1] - p[i]) > EPS && ccw(h[j - 2], h[j - 1], p[i]) == 1) ? (h[j++] = p[i++]) : j--; return --j; } int on_segment(pt a, pt b, pt p) { // is |p| on the segment ||? if (ccw(a, b, p) != 0) return 0; if (creal(p) + 1e-9 < fmin(creal(a), creal(b))) return 0; if (creal(p) - 1e-9 > fmax(creal(a), creal(b))) return 0; return 1; } int main() { int i, n = get_int(), m = -1, x, y; pt a[3*n + 1], b[n], h[n], p; a[3*n] = 0; rep(i, n) { x = get_int(), y = get_int(); b[i] = a[3*i] = x + y*I; a[3*i + 1] = x; a[3*i + 2] = y*I; } n = 3*n + 1; int q = get_int(); while (q--) { char z = getchar(); getchar(); if (z == 'c') { if (m == -1) m = convex_hull(a, h, n); double t = get_int(), x = get_int(), y = get_int(); pt p = x/t + I*y/t; if (m == 1) printf("YES\n"); else { rep(i, m) if (ccw(h[i], h[(i + 1)%m], p) == -1) break; // outside the hull. printf("%s\n", i == m ? "no" : "yes"); } } else { m = -1; int x = get_int() - 1; rep(i, n) if (cabs(b[x] - a[i]) < 1e-9) break; pt s = a[i]; a[i] = a[n - 1]; a[n - 1] = s; n--; rep(i, n) if (fabs(creal(b[x]) - a[i]) < 1e-9) break; s = a[i]; a[i] = a[n - 1]; a[n - 1] = s; n--; rep(i, n) if (fabs(cimag(b[x]) - a[i]) < 1e-9) break; s = a[i]; a[i] = a[n - 1]; a[n - 1] = s; n--; } } return 0; } int get_int() { int ret = 0; char c = getchar(); int sgn; while (1) { if (c == EOF) return EOF; if (c >= '0' && c <= '9') { sgn = 1; break; } if (c == '-') { c = getchar(); if (c < '0' || c > '9') continue; sgn = -1; break; } c = getchar(); } while (1) { ret = ret*10 + c - '0'; c = getchar(); if (c < '0' || c > '9') return sgn*ret; } }