#include #include #include #include #include #define ll long long #define inf 1e9 #define eps 1e-10 #define md #define N 100010 using namespace std; int X[N],Y[N]; int main() { int n,m,K,Q,tt; scanf("%d",&tt); while (tt--) { memset(X,0,sizeof(X)); memset(Y,0,sizeof(Y)); scanf("%d%d%d%d",&n,&m,&K,&Q); for (int i=1;i<=K;i++) { int x,y; scanf("%d%d",&x,&y); X[x]=Y[y]=1; } for (int i=1;i<=n;i++) X[i]+=X[i-1]; for (int i=1;i<=m;i++) Y[i]+=Y[i-1]; for (int i=1;i<=Q;i++) { int x1,y1,x2,y2; 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; }