#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template <class K, class V>
class RadixHeap {
    static constexpr int bit_length = sizeof(K)*8;
    K last;
    size_t sz, cnt;
    array<vector<pair<K, V>>, bit_length> v;
    static inline int bsr(int x){
        return x ? bit_length-__builtin_clz(x) : 0;
    }
    static inline int bsr(ll x){
        return x ? bit_length-__builtin_clzll(x) : 0;
    }

    void pull() {
        if(cnt < v[0].size()) return;;
        int i = 1;
        while(v[i].empty()) i++;
        last = min_element(v[i].begin(),v[i].end())->first;
        for (auto &&x : v[i]) v[bsr(x.first ^ last)].push_back(x);
        v[i].clear();
    }
public:
    RadixHeap() : last(0), sz(0), cnt(0) {}
    void emplace(K x, V val){
        sz++;
        v[bsr(x^last)].emplace_back(x, val);
    }

    pair<K, V> top() {
        pull();
        return v[0][cnt];
    }

    void pop() {
        pull();
        sz--;
        cnt++;
    }

    size_t size() const { return sz; }
    bool empty() const { return !sz; }
};

template<typename F, typename C>
struct PrimalDual {
    struct edge {
        int to; F cap; C cost; int rev;
        edge() = default;
        edge(int to, F cap, C cost, int rev):to(to), cap(cap), cost(cost), rev(rev) {};
    };
    vector<vector<edge>> G;
    vector<C> potential, min_cost;
    vector<int> prevv, preve;

    explicit PrimalDual(int n) : G(n), potential(n), min_cost(n), prevv(n), preve(n) {}

    void add_edge(int u, int v, F cap, C cost){
        G[u].emplace_back(v, cap, cost, G[v].size());
        G[v].emplace_back(u, 0, -cost, G[u].size()-1);
    }


    void dijkstra(int s){

        RadixHeap<C, int> Q;
        fill(min_cost.begin(),min_cost.end(), INF<C>);
        min_cost[s] = 0;
        Q.emplace(0, s);
        while(!Q.empty()){
            pair<C, int> p = Q.top(); Q.pop();
            int v = p.second;
            if(min_cost[v] < p.first) continue;
            for(int i = 0; i < G[v].size(); ++i){
                edge &e=G[v][i];
                if(e.cap==0) continue;
                if(min_cost[v]+e.cost+potential[v]-potential[e.to] < min_cost[e.to]){
                    min_cost[e.to] = min_cost[v]+e.cost+potential[v]-potential[e.to];
                    prevv[e.to] = v;
                    preve[e.to] = i;
                    Q.emplace(min_cost[e.to], e.to);
                }
            }
        }
    }

    C flow(int s, int t, F fl, int &ok){
        C res = 0;
        fill(potential.begin(),potential.end(), 0);
        while(fl > 0){
            dijkstra(s);
            if(min_cost[t] == INF<C>){
                ok = 0;
                return res;
            }
            for (int i = 0; i < potential.size(); ++i) {
                if(min_cost[i] < INF<C>) potential[i] += min_cost[i];
            }

            F d = fl;
            for(int v = t; v != s; v = prevv[v]){
                d = min(d, G[prevv[v]][preve[v]].cap);
            }
            fl -= d;
            res += potential[t]*d;
            for(int v = t; v != s; v = prevv[v]){
                G[prevv[v]][preve[v]].cap -= d;
                G[v][G[prevv[v]][preve[v]].rev].cap += d;
            }
        }
        ok = 1;
        return res;
    }
};

void solve(int n, int m, int b){
    vector<int> ax(n), ay(n);
    for (int i = 0; i < n; ++i) {
        cin >> ax[i] >> ay[i];
    }
    vector<int> bx(m), by(m), c(m), v(m);
    for (int i = 0; i < m; ++i) {
        cin >> bx[i] >> by[i] >> c[i] >> v[i];
    }
    int ans = INF<int>;
    for (int i = 1; i < (1 << m); ++i) {
        auto f = [&](int x) -> int {
            PrimalDual<int, int> G(2+m+n);
            int ans = 0;
            for (int j = 0; j < m; ++j) {
                if(i & (1 << j)){
                    ans += v[j]+b*x;
                    G.add_edge(0, j+2, c[j], 0);
                    for (int k = 0; k < n; ++k) {
                        G.add_edge(j+2, m+2+k, 1, max(0, (abs(ax[k]-bx[j])+abs(ay[k]-by[j]))-x));
                    }
                }
            }
            for (int j = 0; j < n; ++j) {
                G.add_edge(m+2+j, 1, 1, 0);
            }
            int flg = 0;
            ans += G.flow(0, 1, n, flg);
            if(!flg) return INF<int>;
            else return ans;
        };
        int ok = 0, ng = 5000;
        while(ng-ok > 1){
            int mid = (ng+ok)/2;
            if(f(mid-1) >= f(mid)) ok = mid;
            else ng = mid;
        }
        ans = min(ans, f(ok));
    }
    cout << ans << "\n";
}

int main() {
    int n, m, b;
    while(cin >> n >> m >> b, n){
        solve(n, m, b);
    }
    return 0;
}


Measured memory_bytes: 3196