For every query output "Yes" or "No" as mentioned above.
//qscqesze
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 150001
#define mod 10007
#define eps 1e-9
//const int inf=0x7fffffff; //无限大
const int inf=0x3f3f3f3f;
/*
inline ll read()
{
int x=0,f=1;char ch=getchar();
while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}
return x*f;
}
*/
//**************************************************************************************
struct data{
int l,r,mn;
}tr[maxn*4];
data tr2[maxn*4];
void build2(int k,int s,int t)
{
tr2[k].l=s;tr2[k].r=t;
if(s==t){tr2[k].mn=0;return;}
int mid=(s+t)>>1;
build2(k<<1,s,mid);
build2(k<<1|1,mid+1,t);
tr2[k].mn=min(tr2[k<<1].mn,tr2[k<<1|1].mn);
}
int ask2(int k,int s,int t)
{
int l=tr2[k].l,r=tr2[k].r;
if(s==l&&t==r)return tr2[k].mn;
int mid=(l+r)>>1;
if(t<=mid)return ask2(k<<1,s,t);
if(s>mid)return ask2(k<<1|1,s,t);
return min(ask2(k<<1,s,mid),ask2(k<<1|1,mid+1,t));
}
void update2(int k,int x,int y)
{
int l=tr2[k].l,r=tr2[k].r;
if(l==r){tr2[k].mn=y;return;}
int mid=(l+r)>>1;
if(x<=mid)update2(k<<1,x,y);
if(x>mid)update2(k<<1|1,x,y);
tr2[k].mn=min(tr2[k<<1].mn,tr2[k<<1|1].mn);
}
void build(int k,int s,int t)
{
tr[k].l=s;tr[k].r=t;
if(s==t){tr[k].mn=0;return;}
int mid=(s+t)>>1;
build(k<<1,s,mid);
build(k<<1|1,mid+1,t);
tr[k].mn=min(tr[k<<1].mn,tr[k<<1|1].mn);
}
int ask(int k,int s,int t)
{
int l=tr[k].l,r=tr[k].r;
if(s==l&&t==r)return tr[k].mn;
int mid=(l+r)>>1;
if(t<=mid)return ask(k<<1,s,t);
if(s>mid)return ask(k<<1|1,s,t);
return min(ask(k<<1,s,mid),ask(k<<1|1,mid+1,t));
}
void update(int k,int x,int y)
{
int l=tr[k].l,r=tr[k].r;
if(l==r){tr[k].mn=y;return;}
int mid=(l+r)>>1;
if(x<=mid)update(k<<1,x,y);
if(x>mid)update(k<<1|1,x,y);
tr[k].mn=min(tr[k<<1].mn,tr[k<<1|1].mn);
}
int main()
{
int t;scanf("%d",&t);
while(t--)
{
int n,m,k,q;
scanf("%d%d%d%d",&n,&m,&k,&q);
build(1,1,n);
build2(1,1,m);
for(int i=1;i<=k;i++)
{
int x,y;
scanf("%d%d",&x,&y);
update(1,x,1);
update2(1,y,1);
}
for(int i=1;i<=q;i++)
{
int x1,x2,y1,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
if(x1>x2)swap(x1,x2);
if(y1>y2)swap(y1,y2);
int d1 = max(ask(1,x1,x2),ask2(1,y1,y2));
if(d1==1)
printf("Yes\n");
else
printf("No\n");
}
}
return 0;
}