import std.stdio;
import core.stdc.stdio;
import std.container;
import std.algorithm;
import std.typecons;
import std.math;

static immutable int inf=1145141919;

struct MinCostFlow{
	struct Edge{
		int to,cost,cap,rev;
	}
	Array!Edge[] graph;
	alias Tuple!(int,"dist",int,"v") dv;
	dv[] pqBuf;
	int[] h,pV,pE,d;
	void Init(int maxV,int maxE){
		graph=new Array!Edge[maxV];
		foreach(ref g;graph)
			g.reserve(maxV);
		h=new int[maxV];
		pV=new int[maxV];
		pE=new int[maxV];
		d=new int[maxV];
		pqBuf=new dv[maxE];
	}
	int n;
	void Set(int s){
		n=s;
		foreach(ref g;graph[0..n])
			g.clear;
	}
	void AddEdge(int from,int to,int cost,int cap){
		graph[from]~=Edge(to,cost,cap,cast(int)graph[to].length);
		graph[to]~=Edge(from,-cost,0,cast(int)graph[from].length-1);
	}
	int Calc(int s,int t,int f){
		int res;
		h[0..n]=0;
		while(f>0){
			auto pq=BinaryHeap!(dv[],"a>b")(pqBuf,0);
			pq.insert(dv(0,s));
			d[0..n]=inf;
			d[s]=0;
			while(!pq.empty){
				dv top=pq.front;
				pq.popFront;
				with(top){
					if(d[v]<dist) continue;
					int i;
					foreach(e;graph[v]){
						int z=dist+e.cost+h[v]-h[e.to];
						if(e.cap&&d[e.to]>z){
							pV[e.to]=v;
							pE[e.to]=i;
							d[e.to]=z;
							pq.insert(dv(z,e.to));
						}
						i++;
					}
				}
			}
			if(d[t]==inf)
				return inf;
			foreach(i;0..n)
				h[i]+=d[i];
			int k=f;
			for(int u=t;u!=s;u=pV[u])
				k=min(k,graph[pV[u]][pE[u]].cap);
			f-=k;
			res+=k*h[t];
			for(int u=t;u!=s;u=pV[u]){
				graph[pV[u]][pE[u]].cap-=k;
				graph[u][graph[pV[u]][pE[u]].rev].cap+=k;
			}
		}
		return res;
	}
}
MinCostFlow mcf;

int n,m,b;
int[100] ax,ay,bx,by,c,f;

bool Input(){
	scanf("%d%d%d",&n,&m,&b);
	if(!n&&!m&&!b)
		return false;
	foreach(i;0..n)
		scanf("%d%d",&ax[i],&ay[i]);
	foreach(i;0..m)
		scanf("%d%d%d%d",&bx[i],&by[i],&c[i],&f[i]);
	return true;
}

int SolveSub(int ven,int d){
	mcf.Set(n+m+2);
	foreach(i;0..n)
		mcf.AddEdge(n+m,i,0,1);
	int p;
	foreach(i;0..m)
		if((ven>>i)&1){
			p+=f[i]+d*b;
			foreach(j;0..n)
				mcf.AddEdge(j,n+i,max(0,abs(ax[j]-bx[i])+abs(ay[j]-by[i])-d),1);
			mcf.AddEdge(n+i,n+m+1,0,c[i]);
		}
	return p+mcf.Calc(n+m,n+m+1,n);
}

void Solve(){
	int ans=inf;
	foreach(k;1..(1<<m)){
		int l=-1,r=4001;
		while(r-l>1){
			int mid=(l+r)/2;
			int s1=SolveSub(k,mid);
			int s2=SolveSub(k,mid+1);
			ans=min(ans,s1,s2);
			if(s1>s2)
				l=mid;
			else
				r=mid;
		}
	}
	printf("%d\n",ans);
}

void main(){
	mcf.Init(110,1200);
	while(Input) Solve;
}