#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define REACH cerr<<"reached line "<<__LINE__<<endl
#define DBG(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl

using uint=unsigned int;
using ll=long long;
using pii=pair<int,int>;
using vi=vector<int>;
using ld=long double;

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"[";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"]";
	return os;
}

int read(){
	int i;
	scanf("%d",&i);
	return i;
}

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}

void No(){
	cout<<"No"<<endl;
	exit(0);
}

template<class T>
void chmax(T& a,T b){
	a=max(a,b);
}

template<class T>
void chmin(T& a,T b){
	a=min(a,b);
}

template<class T>
void ResetVector(vector<T>& v,int n,const T& t){
	v.clear();
	v.resize(n,t);
}

namespace MinCostFlow{
	const int inf=1145141919;
	struct Edge{
		int to,rev,cost,cap;
	};
	vector<vector<Edge>> g;
	int n;
	vi h,dist,prevv,preve;
	void Init(int _n){
		n=_n;
		ResetVector(g,n,vector<Edge>());
		ResetVector(h,n,0);
		ResetVector(dist,n,0);
		ResetVector(prevv,n,0);
		ResetVector(preve,n,0);
	}
	void AddEdge(int from,int to,int cost,int cap){
		g[from].PB({to,(int)g[to].size(),cost,cap});
		g[to].PB({from,(int)g[from].size()-1,-cost,0});
	}
	pii go(int s,int t,int f){
		priority_queue<pii,vector<pii>,greater<pii>> q;
		fill(dist.begin(),dist.end(),inf);
		dist[s]=0;
		q.push(MP(0,s));
		while(!q.empty()){
			int v=q.top().second,d=q.top().first;q.pop();
			if(dist[v]<d)
				continue;
			REP(i,(int)g[v].size()){
				Edge e=g[v][i];
				if(e.cap>0){
					int w=dist[v]+e.cost+h[v]-h[e.to];
					if(w<dist[e.to]){
						dist[e.to]=w;
						q.push(MP(w,e.to));
						prevv[e.to]=v;
						preve[e.to]=i;
					}
				}
			}
		}
		if(dist[t]==inf)
			return MP(0,0);
		REP(i,n)
			h[i]+=dist[i];
		int d=f;
		for(int v=t;v!=s;v=prevv[v])
			chmin(d,g[prevv[v]][preve[v]].cap);
		for(int v=t;v!=s;v=prevv[v]){
			Edge& e=g[prevv[v]][preve[v]];
			e.cap-=d;
			g[e.to][e.rev].cap+=d;
		}
		return MP(d,d*h[t]);
	}
	int Calc(int s,int t,int f){
		int res=0;
		while(f>0){
			pii w=go(s,t,f);
			if(w.first==0)
				return inf;
			f-=w.first;
			res+=w.second;
		}
		return res;
	}
}

namespace Solve{
	const int inf=1145141919;
	int n,m,b;
	int ax[100],ay[100],bx[5],by[5],c[5],f[5];
	 
	bool Input(){
		scanf("%d%d%d",&n,&m,&b);
		if(!n&&!m&&!b)
			return false;
		REP(i,n)
			scanf("%d%d",&ax[i],&ay[i]);
		REP(i,m)
			scanf("%d%d%d%d",&bx[i],&by[i],&c[i],&f[i]);
		return true;
	}
	 
	int SolveSub(int ven,int d){
		MinCostFlow::Init(n+m+2);
		REP(i,n)
			MinCostFlow::AddEdge(n+m,i,0,1);
		int p=0;
		REP(i,m)
			if((ven>>i)&1){
				p+=f[i]+d*b;
				REP(j,n)
					MinCostFlow::AddEdge(j,n+i,max(0,abs(ax[j]-bx[i])+abs(ay[j]-by[i])-d),1);
				MinCostFlow::AddEdge(n+i,n+m+1,0,c[i]);
			}
		return p+MinCostFlow::Calc(n+m,n+m+1,n);
	}
	 
	void Solve(){
		int ans=inf;
		FOR(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);
	}
}
int main(){
    while(Solve::Input()) Solve::Solve();
}

Measured memory_bytes: 3316