#include <iostream>
using namespace std;
const int P=400,T=200;
int can[T][P];
int at[P],got[T],tried[T];
bool pick(int txi,int p){
if(tried[txi])return false;
tried[txi]=1;
for(int i=0;i<p;i++){
int x = at[i];
if(can[txi][i]){
if(x==-1){
at[i] = txi;
got[txi] = 1;
return true;
}
if(pick(x,p)){
at[i] = txi;
got[txi] = 1;
return true;
}
}
}
return false;
}
struct person{
int x, y;
};
struct taxi{
int x, y;
};
int f(int a){
if(a<0)return -a;
return a;
}
bool reach(taxi t,person p,int d){
long long dist = f(t.x-p.x) + f(t.y-p.y);
dist*=200;
if(dist<=d)return true;
return false;
}
int main() {
// your code goes here
int T,p,t,j,i,s,c;
cin>>T;
while(T--){
cin>>p>>t>>s>>c;
person Y[p];
taxi X[t];
for(i=0;i<p;i++){
cin>>Y[i].x>>Y[i].y;
at[i] = -1;
}
for(i=0;i<t;i++){
cin>>X[i].x>>X[i].y;
got[i] = 0;
}
for(i=0;i<t;i++)
for(j=0;j<p;j++)
can[i][j]=0;
for(i=0;i<t;i++)
for(j=0;j<p;j++)
if(reach(X[i],Y[j],c*s))
can[i][j]=1;
int ans = 0;
for(i=0;i<t;i++){
for(j=0;j<t;j++)
tried[j]=0;
if(!got[i] && pick(i,p))ans++;
}
cout<<ans<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjb25zdCBpbnQgUD00MDAsVD0yMDA7CmludCBjYW5bVF1bUF07CmludCBhdFtQXSxnb3RbVF0sdHJpZWRbVF07CmJvb2wgcGljayhpbnQgdHhpLGludCBwKXsKCWlmKHRyaWVkW3R4aV0pcmV0dXJuIGZhbHNlOwoJdHJpZWRbdHhpXT0xOwoJZm9yKGludCBpPTA7aTxwO2krKyl7CgkJaW50IHggPSBhdFtpXTsKCQlpZihjYW5bdHhpXVtpXSl7CgkJCWlmKHg9PS0xKXsKCQkJCWF0W2ldID0gdHhpOwoJCQkJZ290W3R4aV0gPSAxOwoJCQk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