#include #include int main() { int i, j; int x[100010], y[100010]; int n, m, k, q; int x1, x2, y1, y2; int T; scanf("%d", &T); while (T--) { scanf("%d%d%d%d", &n, &m, &k, &q); memset(x, 0, sizeof(x)); memset(y, 0, sizeof(y)); for (i = 1; i <= k; i++) { int a, b; scanf("%d%d",&a, &b); x[a] = 1; y[b] = 1; } for (i = 1; i <= n; i++) x[i] += x[i - 1]; for (i = 1; i <= m; i++) y[i] += y[i - 1]; while (q--) { scanf("%d%d%d%d", &x1, &y1, &x2, &y2); if (x[x2] - x[x1 - 1] == x2 - x1 + 1 || y[y2] - y[y1 - 1] == y2 - y1 + 1) printf("Yes\n"); else printf("No\n"); } } return 0; }