#include #include #include using namespace std; int n,m,q,k,s[1000005],ss[1000005]; int main(){ int tt;scanf("%d",&tt); for (;tt--;){ scanf("%d%d%d%d",&n,&m,&k,&q); for (int i=1;i<=n;i++) s[i]=0; for (int i=1;i<=m;i++) ss[i]=0; for (int i=1;i<=k;i++){ int x,y;scanf("%d%d",&x,&y); s[x]=1;ss[y]=1; } for (int i=1;i<=n;i++) s[i]+=s[i-1]; for (int i=1;i<=m;i++) ss[i]+=ss[i-1]; for (;q--;){ int x,y,xx,yy;scanf("%d%d%d%d",&x,&y,&xx,&yy); if (s[xx]-s[x-1]==xx-x+1||ss[yy]-ss[y-1]==yy-y+1) puts("Yes"); else puts("No"); } } }