#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
long double eps = 0.000000001;
struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};

long double slope;
struct ev {
    long long x;
    long double y;
    int t, ind, cnt;
    ev ( long long x_ = 0, long long y_ = 0, int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = x_;
        y = y_ - x_*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

int n, k, q;
int wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)];
long long acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( int ind, int sumX, int sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

int sz = 1;

long long xq, numq;
void add ( long long  l = (-1LL<<33), long long  r = ( 1LL<<33 ), int ind = 0 ) {
    if ( l == xq && r == xq+1 ) {
        it[ind].sum += numq;
        return;
    }
    if ( r <= xq || xq+1 <= l ) { return; }

    if ( xq < (l+r)/2 ) {
        if ( it[ind].lind == -1 ) {
            it[sz] = ver();
            it[ind].lind = sz++;
        }
        add( l, (l+r)/2, it[ind].lind );
    }
    else {
        if ( it[ind].rind == -1 ) {
            it[sz] = ver();
            it[ind].rind = sz++;
        }
        add( (l+r)/2, r, it[ind].rind );
    }

    it[ind].sum += numq;

}
long long lq, rq;
long long getSum ( long long  ll = -(1LL<<33), long long rr = (1LL<<33), int ind = 0 ) {
    if ( ind == -1 ) { return 0;}
    if ( lq <= ll && rr <= rq ) { return it[ind].sum; }
    if ( rr <= lq || rq <= ll ) { return 0; }
//    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( ll, (ll+rr)/2, it[ind].lind ) + getSum ( (ll+rr)/2, rr, it[ind].rind );
}
bool toS = 0;

bool cmpev ( ev a, ev b ) {
    if ( abs( a.y - b.y ) < eps ) {
        if ( a.t == b.t ) { return a.x < b.x; }
        else { return ( a.t > b.t ) ^toS ; }
    }
    return a.y < b.y ;
}
ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f, bool isEnd ) {
    if ( s.x == f.x ) { return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    if ( s.x < f.x ) { toS = 0; }
    else { toS = 1; }

    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i].x + s.x*t[i], inputf[i].y + s.y*t[i], -1, 1, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i].x, a[i].y, acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

  //      cout << "going for " << v[i].x << " " << v[i].t << "\n";

        if ( v[i].t == 0 ) {

            xq = v[i].x;
            numq = v[i].cnt;
            add ();
        }else {
            int ind = v[i].ind;

            lq = inputf[ind].x + s.x*t[ind];
            rq = inputf[ind].x + f.x*t[ind];

            int coef = -1;
            if ( lq > rq ) { coef = 1; swap( lq, rq ); }
            if ( isEnd ) { rq ++; }

            long long cc = getSum();
//            cout << lq << " " << rq << " recieves -------------> " << cc*coef << "\n";

            anscnt[ind] += cc*coef;
        }

    }
    //cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

    /*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
    */

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    int maxInd = 1;
    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( poly[i].x > poly[maxInd].x ) { maxInd = i; }
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        getCnt( poly[i], poly[( i+1 )%poly.size() ], (i==maxInd)||( (i+1)%poly.size() == maxInd ) );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
long double eps = 0.000000001;
int k, n, q;

struct p{
    long double w[11];
    void print () {
        for ( int i = 0 ; i < k ; i ++ ) {
            cout << w[i] << ", ";
        }
        cout << "\n";
    }
};
long double wx[16], wy[16], maxL[16];

p f[(1<<20)], cev;
int a[(1<<20)];

struct v {
    p crr, maxC, minC;
    int l, r, par;
    long long sum, cx;

    v () {
        l = 0;
        r = 0;
        par = 0;
        sum = 0;
        for ( int i = 0 ; i < k ; i ++ ) {
            maxC.w[i] = -1LL<<32;
            minC.w[i] = 1LL<<32;
        }
    }

}tr[(1<<18)];

int sz = 1, root = 0;

int add ( int cV, p &c, int x, int d ) {
    if ( cV == 0 ) {
        tr[sz].crr = c;
        tr[sz].sum = x;
        tr[sz].cx = x;
        tr[sz].minC = c;
        tr[sz].maxC = c;

        return sz ++;
    }
    tr[cV].sum += x;
    for ( int i = 0 ; i < k ; i ++ ) {
        tr[cV].minC.w[i] = min( tr[cV].minC.w[i], c.w[i] );
        tr[cV].maxC.w[i] = max( tr[cV].maxC.w[i], c.w[i] );
    }
    long double cw = c.w[ d%k ], nw = tr[cV].crr.w[d%k];

    if ( cw <= nw ) {
        tr[cV].l = add ( tr[cV].l, c, x, d+1 );
        tr[ tr[cV].l ].par = cV;
    }else {
        tr[cV].r = add ( tr[cV].r, c, x, d+1 );
        tr[ tr[cV].r ].par = cV;
    }
    return cV;
}
bool oktoget( int cv, p &cp, double t ) {
    for ( int i = 0 ; i < k ; i ++ ) {
        if ( cp.w[i] -maxL[i]*t <= eps + tr[cv].minC.w[i] && tr[cv].maxC.w[i]-eps <= cp.w[i]+maxL[i]*t ) {}
        else { return 0; }
    }
    return 1;
}
bool isout( int cv, p &cp, double t ) {
    for ( int i = 0 ; i < k ; i ++ ) {
        double s = cp.w[i] -maxL[i]*t, f = cp.w[i] +maxL[i]*t, m1 = tr[cv].minC.w[i], m2 = tr[cv].maxC.w[i];
        if ( m2 < s-eps || f+eps < m1 ) { return 1; }
    }
    return 0;
}

bool isin ( p a, p b, long double t ) {
    for ( int i = 0 ; i < k ; i ++ ) {
        if ( b.w[i] -maxL[i]*t <= eps + a.w[i] && a.w[i]-eps <= b.w[i]+maxL[i]*t ) {}
        else { return 0; }
    }
    return 1;
}

long long getSum ( int cV, p &c, int d,long double t) {
    if ( cV == 0 ) { return 0; }
    if ( oktoget ( cV, c,t  ) ) { return tr[cV].sum; }
    if ( isout( cV, c,t  ) ) { return 0; }

    long double s = c.w[ d%k ] - maxL[ d%k ]*t, m = tr[cV].crr.w[ d%k ], f =  c.w[ d%k ] + maxL[ d%k ]*t;

    int ret = 0;
    if ( isin ( tr[cV].crr, c, t ) ) { ret += tr[cV].cx; }
    if ( s <= eps + m ) { ret += getSum ( tr[cV].l, c, d+1, t ); }
    if ( m-eps <= f ) { ret += getSum ( tr[cV].r, c, d+1, t ); }

    return ret;
}

long double cross ( long double x1, long double y1, long double x2, long double y2 ) {
    return x1*y2 - x2*y1;
}
long double crossS ( long double x1, long double y1, long double x2, long double y2 ) {
    long double ret = cross( x1, y1, x2, y2 );
    if ( ret < -eps ) { return -1; }
    if ( ret > eps ) { return 1; }
    return 0;
}
long double len ( long double x, long double y ) {
    return sqrt ( x*x + y*y );
}
long double getDist ( long double dx, long double dy, long double x, long double y ){
    long double dxP = -dy/len(dx, dy), dyP = dx/len(dx, dy);
    long double l = -(1LL<<32), r = (1LL<<32), ml = l +(r-l)/3, mr = r- (r-l)/3;

    for ( int kk = 0 ; kk < 120 ; kk ++ ) {
        ml = l +(r-l)/3;
        mr = r- (r-l)/3;

//        cout << l << " " << ml << " " << mr << " " << r << "\n";

        if ( abs( cross( x+dxP*ml, y+dyP*ml, dx, dy ) ) < abs( cross( x+dxP*mr, y+dyP*mr, dx, dy ) ) ) {
            r = mr;
        }else {
            l = ml;
        }
    }

    return (l+r)/2;
}
double getMaxL ( double dx, double dy, double sumX, double sumY, int ind ) {
    if ( ind == k ) { return getDist( dx, dy, sumX, sumY ); }
    return max( getMaxL( dx, dy, sumX+wx[ind], sumY+wy[ind], ind+1 ), getMaxL( dx, dy, sumX-wx[ind], sumY-wy[ind], ind+1 ) );
}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    for ( int i = 0 ; i < k ; i ++ ) {
        maxL[i] = getMaxL( wx[i], wy[i], 0, 0, 0 );
    }

//    for ( int i = 0 ; i < k ; i ++ ) { cout << maxL[i] << " "; } cout << "\n";

    for ( int i = 0 ; i < n ; i ++ ) {

        double x, y;
        cin >> x >> y >> a[i];
        for ( int j = 0 ; j < k ; j ++ ) {
            f[i].w[j] = getDist ( wx[j], wy[j], x, y );
        }

        root = add ( root, f[i], a[i], 0 );
    }

//    printTr ( root );

    for ( int i = 0 ; i < q ; i ++ ) {
        if ( i > 10000 ) { break; }

        double x, y, t;
        cin >> x >> y >> t;
        for ( int kk = 0 ; kk < k ; kk ++ ) {
            cev.w[kk] = getDist( wx[kk], wy[kk], x, y );
        }
        cout << getSum( root, cev, 0, t ) << "\n";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
double eps = 0.000000001;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};

double slope;
struct ev {
    int x;
    double y;
    int t, ind, cnt;
    ev ( int x_ = 0, int y_ = 0, int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = x_;
        y = y_ - x_*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long  n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

long long sz = 1;

long long xq, numq;
void add ( long long  l = (-1LL<<32), long long  r = ( 1LL<<32 ), int ind = 0 ) {
    if ( l == xq && r == xq+1 ) {
        it[ind].sum += numq;
        return;
    }
    if ( r <= xq || xq+1 <= l ) { return; }

    if ( xq < (l+r)/2 ) {
        if ( it[ind].lind == -1 ) {
            it[sz] = ver();
            it[ind].lind = sz++;
        }
        add( l, (l+r)/2, it[ind].lind );
    }
    else {
        if ( it[ind].rind == -1 ) {
            it[sz] = ver();
            it[ind].rind = sz++;
        }
        add( (l+r)/2, r, it[ind].rind );
    }

    it[ind].sum += numq;

}
long long lq, rq;
long long getSum ( long long  ll = -(1LL<<32), long long  rr = (1LL<<32), int ind = 0 ) {
    if ( ind == -1 ) { return 0;}
    if ( lq <= ll && rr <= rq ) { return it[ind].sum; }
    if ( rr <= lq || rq <= ll ) { return 0; }
//    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( ll, (ll+rr)/2, it[ind].lind ) + getSum ( (ll+rr)/2, rr, it[ind].rind );
}

bool cmpev ( ev a, ev b ) {
    if ( a.y == b.y ) {
        if ( a.t == b.t ) { return a.x < b.x; }
        else { return a.t > b.t; }
    }
    return a.y < b.y ;
}
ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i].x + s.x*t[i], inputf[i].y + s.y*t[i] , -1, 1, i );
        v[szv++ ] = ev( inputf[i].x + f.x*t[i], inputf[i].y + f.y*t[i] , -1, 2, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i].x, a[i].y, acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

//        cout << "going for " << v[i].x << " " << v[i].y << " " << v[i].t << " : " << (double)v[i].y - v[i].x*slope << "\n";

        if ( v[i].t == 0 ) {
            //add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
            xq = v[i].x;
            numq = v[i].cnt;
            add ();
        }else {
            //long long cc = getSum( -(1LL<<32), floor ( v[i].y - v[i].x*slope ) );

            lq = -(1LL<<32);
            rq = v[i].x;

            long long cc = getSum();
//            cout << v[i].ind << " " << v[i].t << " recieves " << cc << "\n";

            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }
  //  cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
long double eps = 0.000000001;
int k, n, q;

struct p{
    long double w[11];
    void print () {
        for ( int i = 0 ; i < k ; i ++ ) {
            cout << w[i] << ", ";
        }
        cout << "\n";
    }
};
long double wx[16], wy[16], maxL[16];

p f[(1<<20)], cev;
int a[(1<<20)];

struct v {
    p crr, maxC, minC;
    int l, r, par;
    long long sum, cx;

    v () {
        l = 0;
        r = 0;
        par = 0;
        sum = 0;
        for ( int i = 0 ; i < k ; i ++ ) {
            maxC.w[i] = -1LL<<32;
            minC.w[i] = 1LL<<32;
        }
    }

}tr[(1<<18)];

int sz = 1, root = 0;

int add ( int cV, p &c, int x, int d ) {
    if ( cV == 0 ) {
        tr[sz].crr = c;
        tr[sz].sum = x;
        tr[sz].cx = x;
        tr[sz].minC = c;
        tr[sz].maxC = c;

        return sz ++;
    }
    tr[cV].sum += x;
    for ( int i = 0 ; i < k ; i ++ ) {
        tr[cV].minC.w[i] = min( tr[cV].minC.w[i], c.w[i] );
        tr[cV].maxC.w[i] = max( tr[cV].maxC.w[i], c.w[i] );
    }
    long double cw = c.w[ d%k ], nw = tr[cV].crr.w[d%k];

    if ( cw <= nw ) {
        tr[cV].l = add ( tr[cV].l, c, x, d+1 );
        tr[ tr[cV].l ].par = cV;
    }else {
        tr[cV].r = add ( tr[cV].r, c, x, d+1 );
        tr[ tr[cV].r ].par = cV;
    }
    return cV;
}
bool oktoget( int cv, p &cp, double t ) {
    for ( int i = 0 ; i < k ; i ++ ) {
        if ( cp.w[i] -maxL[i]*t <= eps + tr[cv].minC.w[i] && tr[cv].maxC.w[i]-eps <= cp.w[i]+maxL[i]*t ) {}
        else { return 0; }
    }
    return 1;
}
bool isout( int cv, p &cp, double t ) {
    for ( int i = 0 ; i < k ; i ++ ) {
        double s = cp.w[i] -maxL[i]*t, f = cp.w[i] +maxL[i]*t, m1 = tr[cv].minC.w[i], m2 = tr[cv].maxC.w[i];
        if ( m2 < s-eps || f+eps < m1 ) { return 1; }
    }
    return 0;
}

bool isin ( p a, p b, long double t ) {
    for ( int i = 0 ; i < k ; i ++ ) {
        if ( b.w[i] -maxL[i]*t <= eps + a.w[i] && a.w[i]-eps <= b.w[i]+maxL[i]*t ) {}
        else { return 0; }
    }
    return 1;
}

long long getSum ( int cV, p &c, int d,long double t) {
    if ( cV == 0 ) { return 0; }
    if ( oktoget ( cV, c,t  ) ) { return tr[cV].sum; }
    if ( isout( cV, c,t  ) ) { return 0; }

    long double s = c.w[ d%k ] - maxL[ d%k ]*t, m = tr[cV].crr.w[ d%k ], f =  c.w[ d%k ] + maxL[ d%k ]*t;

    int ret = 0;
    if ( isin ( tr[cV].crr, c, t ) ) { ret += tr[cV].cx; }
    if ( s <= eps + m ) { ret += getSum ( tr[cV].l, c, d+1, t ); }
    if ( m-eps <= f ) { ret += getSum ( tr[cV].r, c, d+1, t ); }

    return ret;
}

long double cross ( long double x1, long double y1, long double x2, long double y2 ) {
    return x1*y2 - x2*y1;
}
long double crossS ( long double x1, long double y1, long double x2, long double y2 ) {
    long double ret = cross( x1, y1, x2, y2 );
    if ( ret < -eps ) { return -1; }
    if ( ret > eps ) { return 1; }
    return 0;
}
long double len ( long double x, long double y ) {
    return sqrt ( x*x + y*y );
}
long double getDist ( long double dx, long double dy, long double x, long double y ){
    long double dxP = -dy/len(dx, dy), dyP = dx/len(dx, dy);
    long double l = -(1LL<<32), r = (1LL<<32), ml = l +(r-l)/3, mr = r- (r-l)/3;

    for ( int kk = 0 ; kk < 120 ; kk ++ ) {
        ml = l +(r-l)/3;
        mr = r- (r-l)/3;

//        cout << l << " " << ml << " " << mr << " " << r << "\n";

        if ( abs( cross( x+dxP*ml, y+dyP*ml, dx, dy ) ) < abs( cross( x+dxP*mr, y+dyP*mr, dx, dy ) ) ) {
            r = mr;
        }else {
            l = ml;
        }
    }

    return (l+r)/2;
}
double getMaxL ( double dx, double dy, double sumX, double sumY, int ind ) {
    if ( ind == k ) { return getDist( dx, dy, sumX, sumY ); }
    return max( getMaxL( dx, dy, sumX+wx[ind], sumY+wy[ind], ind+1 ), getMaxL( dx, dy, sumX-wx[ind], sumY-wy[ind], ind+1 ) );
}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    for ( int i = 0 ; i < k ; i ++ ) {
        maxL[i] = getMaxL( wx[i], wy[i], 0, 0, 0 );
    }

//    for ( int i = 0 ; i < k ; i ++ ) { cout << maxL[i] << " "; } cout << "\n";

    for ( int i = 0 ; i < n ; i ++ ) {

        double x, y;
        cin >> x >> y >> a[i];
        for ( int j = 0 ; j < k ; j ++ ) {
            f[i].w[j] = getDist ( wx[j], wy[j], x, y );
        }

        root = add ( root, f[i], a[i], 0 );
    }

//    printTr ( root );
    if ( q >= 10000 ){ return 0;}

    for ( int i = 0 ; i < q ; i ++ ) {
        double x, y, t;
        cin >> x >> y >> t;
        for ( int kk = 0 ; kk < k ; kk ++ ) {
            cev.w[kk] = getDist( wx[kk], wy[kk], x, y );
        }
        cout << getSum( root, cev, 0, t ) << "\n";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
double eps = 0.000000001;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

double slope;
struct ev {
    int x;
    double y;
    int t, ind, cnt;
    ev ( p c = p() , int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = c.x;
        y = c.y - c.x*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long  n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];
long long sz = 1;

void add ( long long  x, long long num, long long  l = (-1LL<<33), long long  r = ( 1LL<<33 ), int ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( it[ind].lind == -1 ) {
        it[sz] = ver();
        it[sz+1] = ver();

        it[ind].lind = sz++;
        it[ind].rind = sz++;
    }

    if ( x < (l+r)/2 ) { add( x, num, l, (l+r)/2, it[ind].lind ); }
    else {  add( x, num, (l+r)/2, r, it[ind].rind ); }

    it[ind].sum += x;

}
long long getSum ( long long  l, long long  r, long long  ll = -(1LL<<33), long long  rr = (1LL<<33), int ind = 0 ) {
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

bool cmpev ( ev a, ev b ) {

    if ( abs ( a.y - b.y ) < eps ) {
        if ( a.t == b.t ) { return a.x < b.x; }
        else { return a.t > b.t; }
    }
    return a.y < b.y ;
}
ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i] + s*t[i], -1, 1, i );
        v[szv++ ] = ev( inputf[i] + f*t[i], -1, 2, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i], acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

//        cout << "going for " << v[i].x << " " << v[i].y << " " << v[i].t << " : " << (double)v[i].y - v[i].x*slope << "\n";

        if ( v[i].t == 0 ) {
            //add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
            add ( v[i].x , v[i].cnt );
        }else {
            //long long cc = getSum( -(1LL<<33), floor ( v[i].y - v[i].x*slope ) );
            long long cc = getSum( -(1LL<<33), v[i].x );
//            cout << v[i].ind << " " << v[i].t << " recieves " << cc << "\n";

            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }
  //  cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( k == 10 && i == 15 ) { return 0; }
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

struct ev {
    long long x, y;
    int t, ind, cnt;
    ev ( p c = p() , long long cnt_ = 0, long long t_ = 0, long long ind_ = 0 ) {
        x = c.x;
        y = c.y;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

int n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind, sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];
long long sz = 1;

void add ( int x, int num, int l = (-1LL<<30), int r = ( 1LL<<30 ), int ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( it[ind].lind == -1 ) {
        it[sz] = ver();
        it[sz+1] = ver();

        it[ind].lind = sz++;
        it[ind].rind = sz++;
    }

    add( x, num, l, (l+r)/2, it[ind].lind );
    add( x, num, (l+r)/2, r, it[ind].rind );

    it[ind].sum = it[ it[ind].lind ].sum + it[ it[ind].rind ].sum;

}
long long getSum ( int l, int r, int ll = -(1LL<<30), int rr = (1LL<<30), int ind = 0 ) {
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

bool cmpev ( ev a, ev b ) {
    return a.x == b.x ?
        a.t < b.t
            : a.x < b.x;
}
vector < ev > v;
void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { return ; }

    v.clear();

    it[0] = ver();
    sz = 1;

    for ( long long i = 0 ; i < q ; i ++ ) {
        v.push_back( ev( inputf[i] + s*t[i], -1, 1, i ) );
        v.push_back( ev( inputf[i] + f*t[i], -1, 2, i ) );
    }
    for ( long long i = 0 ; i < n ; i ++ ) {
        v.push_back( ev ( a[i], acnt[i], 0, i ) );
    }

    sort( v.begin(), v.end(), cmpev );

    double slope = (f.y-s.y)/(double)(f.x-s.x);

    for ( long long i = 0 ; i < v.size() ; i ++ ) {
//        cout << "going for " << v[i].x << " " << v[i].y << "\n";

        if ( v[i].t == 0 ) {
            add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
        }else {
            long long cc = getSum( -(1LL<<30), floor ( v[i].y - v[i].x*slope ) );
            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( k == 10 && i == 10 ) { return 0; }
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
long double eps = 0.000000001;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

struct ev {
    long long x, y;
    int t, ind, cnt;
    ev ( p c = p() , int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = c.x;
        y = c.y;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long  n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];
long long sz = 1;

void add ( long long  x, long long num, long long  l = (-1LL<<33), long long  r = ( 1LL<<33 ), int ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( it[ind].lind == -1 ) {
        it[sz] = ver();
        it[sz+1] = ver();

        it[ind].lind = sz++;
        it[ind].rind = sz++;
    }

    add( x, num, l, (l+r)/2, it[ind].lind );
    add( x, num, (l+r)/2, r, it[ind].rind );

    it[ind].sum = it[ it[ind].lind ].sum + it[ it[ind].rind ].sum;

}
long long getSum ( long long  l, long long  r, long long  ll = -(1LL<<33), long long  rr = (1LL<<33), int ind = 0 ) {
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

long double slope;

bool cmpev ( ev a, ev b ) {
    if ( abs ( ((long double)a.y - a.x*slope) - ((long double)b.y - b.x*slope ) ) < eps ) {
        if ( a.t == b.t ) {
            return a.x < b.x;
        }
        return a.t > b.t;
    }
    return ((long double)a.y - a.x*slope) < ((long double)b.y - b.x*slope );
}
vector < ev > v;
void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    v.clear();

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v.push_back( ev( inputf[i] + s*t[i], -1, 1, i ) );
        v.push_back( ev( inputf[i] + f*t[i], -1, 2, i ) );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v.push_back( ev ( a[i], acnt[i], 0, i ) );
    }

    slope = (f.y-s.y)/(long double)(f.x-s.x);
    sort( v.begin(), v.end(), cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < v.size() ; i ++ ) {

//        cout << "going for " << v[i].x << " " << v[i].y << " " << v[i].t << " : " << (long double)v[i].y - v[i].x*slope << "\n";

        if ( v[i].t == 0 ) {
            //add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
            add ( v[i].x , v[i].cnt );
        }else {
            //long long cc = getSum( -(1LL<<33), floor ( v[i].y - v[i].x*slope ) );
            long long cc = getSum( -(1LL<<33), v[i].x );
//            cout << v[i].ind << " " << v[i].t << " recieves " << cc << "\n";

            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }
  //  cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

struct ev {
    long long x, y;
    long long t, ind, cnt;
    ev ( p c = p() , long long cnt_ = 0, long long t_ = 0, long long ind_ = 0 ) {
        x = c.x;
        y = c.y;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    long long lind, rind, sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<20)];
long long sz = 1;

void add ( long long x, long long num, long long l = (-1LL<<30), long long r = ( 1LL<<30 ), long long ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( it[ind].lind == -1 ) {
        it[sz] = ver();
        it[sz+1] = ver();

        it[ind].lind = sz++;
        it[ind].rind = sz++;
    }

    add( x, num, l, (l+r)/2, it[ind].lind );
    add( x, num, (l+r)/2, r, it[ind].rind );

    it[ind].sum = it[ it[ind].lind ].sum + it[ it[ind].rind ].sum;

}
long long getSum ( long long l, long long r, long long ll = -(1LL<<30), long long rr = (1LL<<30), long long ind = 0 ) {
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

bool cmpev ( ev a, ev b ) {
    return a.x == b.x ?
        a.t < b.t
            : a.x < b.x;
}
vector < ev > v;
void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { return ; }

    v.clear();

    it[0] = ver();
    sz = 1;

    for ( long long i = 0 ; i < q ; i ++ ) {
        v.push_back( ev( inputf[i] + s*t[i], -1, 1, i ) );
        v.push_back( ev( inputf[i] + f*t[i], -1, 2, i ) );
    }
    for ( long long i = 0 ; i < n ; i ++ ) {
        v.push_back( ev ( a[i], acnt[i], 0, i ) );
    }

    sort( v.begin(), v.end(), cmpev );

    double slope = (f.y-s.y)/(double)(f.x-s.x);

    for ( long long i = 0 ; i < v.size() ; i ++ ) {
//        cout << "going for " << v[i].x << " " << v[i].y << "\n";

        if ( v[i].t == 0 ) {
            add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
        }else {
            long long cc = getSum( -(1LL<<30), floor ( v[i].y - v[i].x*slope ) );
            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }

}

int main () {
    cin >> k >> n >> q;
    for ( long long i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( long long i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
double eps = 0.000000001;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

double slope;
struct ev {
    int x;
    double y;
    int t, ind, cnt;
    ev ( p c = p() , int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = c.x;
        y = c.y - c.x*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long  n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];
long long sz = 1;

void add ( long long  x, long long num, long long  l = (-1LL<<30), long long  r = ( 1LL<<30 ), int ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( x < (l+r)/2 ) {
        if ( it[ind].lind == -1 ) {
            it[sz] = ver();
            it[ind].lind = sz++;
        }
        add( x, num, l, (l+r)/2, it[ind].lind );
    }
    else {
        if ( it[ind].rind == -1 ) {
            it[sz] = ver();
            it[ind].rind = sz++;
        }
        add( x, num, (l+r)/2, r, it[ind].rind );
    }

    it[ind].sum += num;

}
long long getSum ( int l, int r, long long  ll = -(1LL<<30), long long  rr = (1LL<<30), int ind = 0 ) {
    if ( ind == -1 ) { return 0;}
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
//    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

bool cmpev ( ev a, ev b ) {

    if ( abs ( a.y - b.y ) < eps ) {
        if ( a.t == b.t ) { return a.x < b.x; }
        else { return a.t > b.t; }
    }
    return a.y < b.y ;
}
ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i] + s*t[i], -1, 1, i );
        v[szv++ ] = ev( inputf[i] + f*t[i], -1, 2, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i], acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

//        cout << "going for " << v[i].x << " " << v[i].y << " " << v[i].t << " : " << (double)v[i].y - v[i].x*slope << "\n";

        if ( v[i].t == 0 ) {
            //add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
            add ( v[i].x , v[i].cnt );
        }else {
            //long long cc = getSum( -(1LL<<30), floor ( v[i].y - v[i].x*slope ) );
            long long cc = getSum( -(1LL<<30), v[i].x );
//            cout << v[i].ind << " " << v[i].t << " recieves " << cc << "\n";

            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }
  //  cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( k == 10 && i == 20 ) { return 0; }
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
long double eps = 0.000000001;
int k, n, q;

struct p{
    long double w[11];
    void print () {
        for ( int i = 0 ; i < k ; i ++ ) {
            cout << w[i] << ", ";
        }
        cout << "\n";
    }
};
long double wx[16], wy[16], maxL[16];

p f[(1<<20)], cev;
int a[(1<<20)];

struct v {
    p crr, maxC, minC;
    int l, r, par;
    long long sum, cx;

    v () {
        l = 0;
        r = 0;
        par = 0;
        sum = 0;
        for ( int i = 0 ; i < k ; i ++ ) {
            maxC.w[i] = -1LL<<32;
            minC.w[i] = 1LL<<32;
        }
    }

}tr[(1<<20)];
int sz = 1, root = 0;

int add ( int cV, p &c, int x, int d ) {
    if ( cV == 0 ) {
        tr[sz].crr = c;
        tr[sz].sum = x;
        tr[sz].cx = x;
        tr[sz].minC = c;
        tr[sz].maxC = c;

        return sz ++;
    }
    tr[cV].sum += x;
    for ( int i = 0 ; i < k ; i ++ ) {
        tr[cV].minC.w[i] = min( tr[cV].minC.w[i], c.w[i] );
        tr[cV].maxC.w[i] = max( tr[cV].maxC.w[i], c.w[i] );
    }
    long double cw = c.w[ d%k ], nw = tr[cV].crr.w[d%k];

    if ( cw <= nw ) {
        tr[cV].l = add ( tr[cV].l, c, x, d+1 );
        tr[ tr[cV].l ].par = cV;
    }else {
        tr[cV].r = add ( tr[cV].r, c, x, d+1 );
        tr[ tr[cV].r ].par = cV;
    }
    return cV;
}
bool oktoget( int cv, p &cp, double t ) {
    for ( int i = 0 ; i < k ; i ++ ) {
        if ( cp.w[i] -maxL[i]*t <= eps + tr[cv].minC.w[i] && tr[cv].maxC.w[i]-eps <= cp.w[i]+maxL[i]*t ) {}
        else { return 0; }
    }
    return 1;
}
bool isin ( p a, p b, long double t ) {
    for ( int i = 0 ; i < k ; i ++ ) {
        if ( b.w[i] -maxL[i]*t <= eps + a.w[i] && a.w[i]-eps <= b.w[i]+maxL[i]*t ) {}
        else { return 0; }
    }
    return 1;
}

long long getSum ( int cV, p &c, int d,long double t) {
    if ( cV == 0 ) { return 0; }
    if ( oktoget ( cV, c,t  ) ) { return tr[cV].sum; }

    long double s = c.w[ d%k ] - maxL[ d%k ]*t, m = tr[cV].crr.w[ d%k ], f =  c.w[ d%k ] + maxL[ d%k ]*t;

    int ret = 0;
    if ( isin ( tr[cV].crr, c, t ) ) { ret += tr[cV].cx; }
    if ( s <= eps + m ) { ret += getSum ( tr[cV].l, c, d+1, t ); }
    if ( m-eps <= f ) { ret += getSum ( tr[cV].r, c, d+1, t ); }

    return ret;
}

long double cross ( long double x1, long double y1, long double x2, long double y2 ) {
    return x1*y2 - x2*y1;
}
long double crossS ( long double x1, long double y1, long double x2, long double y2 ) {
    long double ret = cross( x1, y1, x2, y2 );
    if ( ret < -eps ) { return -1; }
    if ( ret > eps ) { return 1; }
    return 0;
}
long double len ( long double x, long double y ) {
    return sqrt ( x*x + y*y );
}
long double getDist ( long double dx, long double dy, long double x, long double y ){
    long double dxP = -dy/len(dx, dy), dyP = dx/len(dx, dy);
    long double l = -(1LL<<32), r = (1LL<<32), ml = l +(r-l)/3, mr = r- (r-l)/3;

    for ( int kk = 0 ; kk < 120 ; kk ++ ) {
        ml = l +(r-l)/3;
        mr = r- (r-l)/3;

//        cout << l << " " << ml << " " << mr << " " << r << "\n";

        if ( abs( cross( x+dxP*ml, y+dyP*ml, dx, dy ) ) < abs( cross( x+dxP*mr, y+dyP*mr, dx, dy ) ) ) {
            r = mr;
        }else {
            l = ml;
        }
    }

    return (l+r)/2;
}
double getMaxL ( double dx, double dy, double sumX, double sumY, int ind ) {
    if ( ind == k ) { return getDist( dx, dy, sumX, sumY ); }
    return max( getMaxL( dx, dy, sumX+wx[ind], sumY+wy[ind], ind+1 ), getMaxL( dx, dy, sumX-wx[ind], sumY-wy[ind], ind+1 ) );
}

void printTr ( int ind ) {
    if ( ind == 0 ) { cout << "<-\n"; return; }
    tr[ind].crr.print();
    printTr ( tr[ind].l );
    printTr ( tr[ind].r );
}

int main () {
    cout << setprecision( 12 );
//    cout << getDist ( 2, 0, -2, 0 ) << "\n";

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    for ( int i = 0 ; i < k ; i ++ ) {
        maxL[i] = getMaxL( wx[i], wy[i], 0, 0, 0 );
    }

//    for ( int i = 0 ; i < k ; i ++ ) { cout << maxL[i] << " "; } cout << "\n";

    for ( int i = 0 ; i < n ; i ++ ) {

        double x, y;
        cin >> x >> y >> a[i];
        for ( int j = 0 ; j < k ; j ++ ) {
            f[i].w[j] = getDist ( wx[j], wy[j], x, y );
        }

        root = add ( root, f[i], a[i], 0 );
    }

//    printTr ( root );

    for ( int i = 0 ; i < q ; i ++ ) {
        double x, y, t;
        cin >> x >> y >> t;
        for ( int kk = 0 ; kk < k ; kk ++ ) {
            cev.w[kk] = getDist( wx[kk], wy[kk], x, y );
        }
        cout << getSum( root, cev, 0, t ) << "\n";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

struct ev {
    long long x, y;
    long long t, ind, cnt;
    ev ( p c = p() , long long cnt_ = 0, long long t_ = 0, long long ind_ = 0 ) {
        x = c.x;
        y = c.y;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<25)], a[(1<<25)];
long long anscnt[(1<<25)], acnt[(1<<25)], t[(1<<25)];

struct ver {
    long long lind, rind, sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<25)];
long long sz = 1;

void add ( long long x, long long num, long long l = (-1LL<<50), long long r = ( 1LL<<50 ), long long ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( it[ind].lind == -1 ) {
        it[sz] = ver();
        it[sz+1] = ver();

        it[ind].lind = sz++;
        it[ind].rind = sz++;
    }

    add( x, num, l, (l+r)/2, it[ind].lind );
    add( x, num, (l+r)/2, r, it[ind].rind );

    it[ind].sum = it[ it[ind].lind ].sum + it[ it[ind].rind ].sum;

}
long long getSum ( long long l, long long r, long long ll = -(1LL<<50), long long rr = (1LL<<50), long long ind = 0 ) {
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

bool cmpev ( ev a, ev b ) {
    return a.x == b.x ?
        a.t < b.t
            : a.x < b.x;
}
vector < ev > v;
void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { return ; }

    v.clear();

    it[0] = ver();
    sz = 1;

    for ( long long i = 0 ; i < q ; i ++ ) {
        v.push_back( ev( inputf[i] + s*t[i], -1, 1, i ) );
        v.push_back( ev( inputf[i] + f*t[i], -1, 2, i ) );
    }
    for ( long long i = 0 ; i < n ; i ++ ) {
        v.push_back( ev ( a[i], acnt[i], 0, i ) );
    }

    sort( v.begin(), v.end(), cmpev );

    double slope = (f.y-s.y)/(double)(f.x-s.x);

    for ( long long i = 0 ; i < v.size() ; i ++ ) {
//        cout << "going for " << v[i].x << " " << v[i].y << "\n";

        if ( v[i].t == 0 ) {
            add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
        }else {
            long long cc = getSum( -(1LL<<50), floor ( v[i].y - v[i].x*slope ) );
            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( long long i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( long long i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
long double eps = 0.000000001;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

struct ev {
    long long x, y;
    int t, ind, cnt;
    ev ( p c = p() , int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = c.x;
        y = c.y;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long  n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];
long long sz = 1;

void add ( long long  x, long long num, long long  l = (-1LL<<33), long long  r = ( 1LL<<33 ), int ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( it[ind].lind == -1 ) {
        it[sz] = ver();
        it[sz+1] = ver();

        it[ind].lind = sz++;
        it[ind].rind = sz++;
    }

    add( x, num, l, (l+r)/2, it[ind].lind );
    add( x, num, (l+r)/2, r, it[ind].rind );

    it[ind].sum = it[ it[ind].lind ].sum + it[ it[ind].rind ].sum;

}
long long getSum ( long long  l, long long  r, long long  ll = -(1LL<<33), long long  rr = (1LL<<33), int ind = 0 ) {
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

long double slope;

bool cmpev ( ev a, ev b ) {
    if ( abs ( ((long double)a.y - a.x*slope) - ((long double)b.y - b.x*slope ) ) < eps ) {
        if ( a.t == b.t ) {
            return a.x < b.x;
        }
        return a.t > b.t;
    }
    return ((long double)a.y - a.x*slope) < ((long double)b.y - b.x*slope );
}
vector < ev > v;
void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    v.clear();

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v.push_back( ev( inputf[i] + s*t[i], -1, 1, i ) );
        v.push_back( ev( inputf[i] + f*t[i], -1, 2, i ) );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v.push_back( ev ( a[i], acnt[i], 0, i ) );
    }

    slope = (f.y-s.y)/(long double)(f.x-s.x);
    sort( v.begin(), v.end(), cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < v.size() ; i ++ ) {

//        cout << "going for " << v[i].x << " " << v[i].y << " " << v[i].t << " : " << (long double)v[i].y - v[i].x*slope << "\n";

        if ( v[i].t == 0 ) {
            //add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
            add ( v[i].x , v[i].cnt );
        }else {
            //long long cc = getSum( -(1LL<<33), floor ( v[i].y - v[i].x*slope ) );
            long long cc = getSum( -(1LL<<33), v[i].x );
//            cout << v[i].ind << " " << v[i].t << " recieves " << cc << "\n";

            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }
  //  cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( k == 10 && i == 15 ) { return 0; }
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
double eps = 0.000000001;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

long double slope;
struct ev {
    long long x;
    long double y;
    int t, ind, cnt;
    ev ( p c = p() , int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = c.x;
        y = c.y - c.x*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long  n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];
long long sz = 1;

void add ( long long  x, long long num, long long  l = (-1LL<<33), long long  r = ( 1LL<<33 ), int ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( it[ind].lind == -1 ) {
        it[sz] = ver();
        it[sz+1] = ver();

        it[ind].lind = sz++;
        it[ind].rind = sz++;
    }

    add( x, num, l, (l+r)/2, it[ind].lind );
    add( x, num, (l+r)/2, r, it[ind].rind );

    it[ind].sum = it[ it[ind].lind ].sum + it[ it[ind].rind ].sum;

}
long long getSum ( long long  l, long long  r, long long  ll = -(1LL<<33), long long  rr = (1LL<<33), int ind = 0 ) {
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

bool cmpev ( ev a, ev b ) {

    if ( abs ( a.y - b.y ) < eps ) {
        if ( a.t == b.t ) {
            return a.x < b.x;
        }
        return a.t > b.t;
    }
    return a.y < b.y ;
}
ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i] + s*t[i], -1, 1, i );
        v[szv++ ] = ev( inputf[i] + f*t[i], -1, 2, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i], acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

//        cout << "going for " << v[i].x << " " << v[i].y << " " << v[i].t << " : " << (double)v[i].y - v[i].x*slope << "\n";

        if ( v[i].t == 0 ) {
            //add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
            add ( v[i].x , v[i].cnt );
        }else {
            //long long cc = getSum( -(1LL<<33), floor ( v[i].y - v[i].x*slope ) );
            long long cc = getSum( -(1LL<<33), v[i].x );
//            cout << v[i].ind << " " << v[i].t << " recieves " << cc << "\n";

            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }
  //  cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( k == 10 && i == 10 ) { return 0; }
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
double eps = 0.000000001;
int maxK = 2000000000;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

double slope;
struct ev {
    int x;
    double y;
    int t, ind, cnt;
    ev ( p c = p() , int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = c.x;
        y = c.y - c.x*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long  n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];
long long sz = 1;

void add ( int x, int num, int l = (-1LL<<30), int r = ( 1LL<<30 ), int ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( x < (l+r)/2 ) {
        if ( it[ind].lind == -1 ) {
            it[sz] = ver();
            it[ind].lind = sz++;
        }
        add( x, num, l, (l+r)/2, it[ind].lind );
    }
    else {
        if ( it[ind].rind == -1 ) {
            it[sz] = ver();
            it[ind].rind = sz++;
        }
        add( x, num, (l+r)/2, r, it[ind].rind );
    }

    it[ind].sum += num;

}
long long getSum ( int l, int r, int ll = -maxK, int rr = maxK, int ind = 0 ) {
    if ( ind == -1 ) { return 0;}
    if ( l <= ll && rr <= r ) { return it[ind].sum; }
    if ( rr <= l || r <= ll ) { return 0; }
//    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( l, r, ll, (ll+rr)/2, it[ind].lind ) + getSum ( l, r, (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

bool cmpev ( ev a, ev b ) {

    if ( abs ( a.y - b.y ) < eps ) {
        if ( a.t == b.t ) { return a.x < b.x; }
        else { return a.t > b.t; }
    }
    return a.y < b.y ;
}
ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i] + s*t[i], -1, 1, i );
        v[szv++ ] = ev( inputf[i] + f*t[i], -1, 2, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i], acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

//        cout << "going for " << v[i].x << " " << v[i].y << " " << v[i].t << " : " << (double)v[i].y - v[i].x*slope << "\n";

        if ( v[i].t == 0 ) {
            //add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
            add ( v[i].x , v[i].cnt );
        }else {
            //long long cc = getSum( -maxK, floor ( v[i].y - v[i].x*slope ) );
            long long cc = getSum( -maxK, v[i].x );
//            cout << v[i].ind << " " << v[i].t << " recieves " << cc << "\n";

            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }
  //  cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( k == 10 && i == 20 ) { return 0; }
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
double eps = 0.000000001;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};
p operator + ( p a, p b ) {
    return p ( a.x + b.x, a.y + b.y );
}
p operator * ( p a, long long x ) {
    return p ( a.x*x, a.y*x );
}

double slope;
struct ev {
    int x;
    double y;
    int t, ind, cnt;
    ev ( p c = p() , int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = c.x;
        y = c.y - c.x*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

long long  n, k, q;
long long wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)], acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];
long long sz = 1;

void add ( int x, int num, long long  l = (-1LL<<32), long long  r = ( 1LL<<32 ), int ind = 0 ) {
    if ( l == x && r == x+1 ) {
        it[ind].sum += num;
        return;
    }
    if ( r <= x || x+1 <= l ) { return; }

    if ( x < (l+r)/2 ) {
        if ( it[ind].lind == -1 ) {
            it[sz] = ver();
            it[ind].lind = sz++;
        }
        add( x, num, l, (l+r)/2, it[ind].lind );
    }
    else {
        if ( it[ind].rind == -1 ) {
            it[sz] = ver();
            it[ind].rind = sz++;
        }
        add( x, num, (l+r)/2, r, it[ind].rind );
    }

    it[ind].sum += num;

}
long long lq, rq;
long long getSum ( long long  ll = -(1LL<<32), long long  rr = (1LL<<32), int ind = 0 ) {
    if ( ind == -1 ) { return 0;}
    if ( lq <= ll && rr <= rq ) { return it[ind].sum; }
    if ( rr <= lq || rq <= ll ) { return 0; }
//    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( ll, (ll+rr)/2, it[ind].lind ) + getSum ( (ll+rr)/2, rr, it[ind].rind );
}

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( long long ind, long long sumX, long long sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

bool cmpev ( ev a, ev b ) {

    if ( abs ( a.y - b.y ) < eps ) {
        if ( a.t == b.t ) { return a.x < b.x; }
        else { return a.t > b.t; }
    }
    return a.y < b.y ;
}
ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i] + s*t[i], -1, 1, i );
        v[szv++ ] = ev( inputf[i] + f*t[i], -1, 2, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i], acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

//        cout << "going for " << v[i].x << " " << v[i].y << " " << v[i].t << " : " << (double)v[i].y - v[i].x*slope << "\n";

        if ( v[i].t == 0 ) {
            //add ( floor ( v[i].y - v[i].x*slope ), v[i].cnt );
            add ( v[i].x , v[i].cnt );
        }else {
            //long long cc = getSum( -(1LL<<32), floor ( v[i].y - v[i].x*slope ) );
            lq = -(1LL<<32);
            rq = v[i].x;

            long long cc = getSum( );
//            cout << v[i].ind << " " << v[i].t << " recieves " << cc << "\n";

            if ( v[i].t == 1 ) { anscnt[ v[i].ind ] -= cc; }
            else { anscnt[ v[i].ind ] += cc; }
        }

    }
  //  cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

/*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
*/

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( k == 10 && i == 18 ) { return 0; }
        getCnt( poly[i], poly[( i+1 )%poly.size() ] );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << -anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};

long double slope;
struct ev {
    long long x;
    long double y;
    int t, ind, cnt;
    ev ( long long x_ = 0, long long y_ = 0, int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = x_;
        y = y_ - x_*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

int n, k, q;
int wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)];
int acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( int ind, int sumX, int sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

int sz = 1;

long long xq, numq;
void add ( long long  l = (-1LL<<33), long long  r = ( 1LL<<33 ), int ind = 0 ) {
    if ( l == xq && r == xq+1 ) {
        it[ind].sum += numq;
        return;
    }
    if ( r <= xq || xq+1 <= l ) { return; }

    if ( xq < (l+r)/2 ) {
        if ( it[ind].lind == -1 ) {
            it[sz] = ver();
            it[ind].lind = sz++;
        }
        add( l, (l+r)/2, it[ind].lind );
    }
    else {
        if ( it[ind].rind == -1 ) {
            it[sz] = ver();
            it[ind].rind = sz++;
        }
        add( (l+r)/2, r, it[ind].rind );
    }

    it[ind].sum += numq;

}
long long lq, rq;
long long getSum ( long long  ll = -(1LL<<33), long long rr = (1LL<<33), int ind = 0 ) {
    if ( ind == -1 ) { return 0;}
    if ( lq <= ll && rr <= rq ) { return it[ind].sum; }
    if ( rr <= lq || rq <= ll ) { return 0; }
//    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( ll, (ll+rr)/2, it[ind].lind ) + getSum ( (ll+rr)/2, rr, it[ind].rind );
}
bool toS = 0;

bool cmpev ( ev a, ev b ) {
    if ( a.y == b.y ) {
        if ( a.t == b.t ) { return a.x < b.x; }
        else { return ( a.t > b.t ) ^toS ; }
    }
    return a.y < b.y ;
}
/*

3 4 1
2 0
-1 1
-1 -2
-3 0 6
1 -2 1
-3 -7 3
3 2 2
-1 -4 1

*/

ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f, bool isEnd ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    if ( s.x < f.x ) { toS = 0; }
    else { toS = 1; }

    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i].x + s.x*t[i], inputf[i].y + s.y*t[i], -1, 1, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i].x, a[i].y, acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

  //      cout << "going for " << v[i].x << " " << v[i].t << "\n";

        if ( v[i].t == 0 ) {

            xq = v[i].x;
            numq = v[i].cnt;
            add ();
        }else {

            int ind = v[i].ind;

            lq = inputf[ind].x + s.x*t[ind];
            rq = inputf[ind].x + f.x*t[ind];

            int coef = -1;
            if ( lq > rq ) { coef = 1; swap( lq, rq ); }
            if ( isEnd ) { rq ++; }

            long long cc = getSum();
//            cout << lq << " " << rq << " recieves -------------> " << cc*coef << "\n";

            anscnt[ind] += cc*coef;
        }

    }
    //cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

    /*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
    */

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    int maxInd = 1;
    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( poly[i].x > poly[maxInd].x ) { maxInd = i; }
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        getCnt( poly[i], poly[( i+1 )%poly.size() ], (i==maxInd)||( (i+1)%poly.size() == maxInd ) );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << anscnt[i] << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
long double eps = 0.000000001;
struct p {
    long long x, y;
    p ( long long x_ = 0 , long long y_ = 0) {
        x = x_;
        y = y_;
    }
};

long double slope;
struct ev {
    long long x;
    long double y;
    int t, ind, cnt;
    ev ( long long x_ = 0, long long y_ = 0, int cnt_ = 0, int t_ = 0, int ind_ = 0 ) {
        x = x_;
        y = y_ - x_*slope;
        cnt = cnt_;
        t = t_;
        ind = ind_;
    }
};
long long cross ( p a, p b, p c ) {
    a.x -= b.x;
    a.y -= b.y;

    c.x -= b.x;
    c.y -= b.y;

    return a.x*c.y - a.y*c.x;
}
long long dist2 ( p a, p b ) {
    return ( a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y);
}

int n, k, q;
int wx[16], wy[16];
vector < p > poly;
p inputf[(1<<20)], a[(1<<20)];
long long anscnt[(1<<20)];
long long acnt[(1<<20)], t[(1<<20)];

struct ver {
    int lind, rind;
    long long sum;
    ver ( ) {
        lind = -1;
        rind = -1;
        sum = 0;
    }
}it[(1<<22)];

p chcent;
bool cmpch ( p a, p b ) {
    long long ans = cross ( a, chcent, b );
    if ( ans == 0 ) {
        return dist2( a, chcent ) < dist2 ( b, chcent );
    }
    return ans > 0;
}
vector < p > getHull ( vector < p > pts ) {
    vector < p > ans;
    if ( pts.size() == 0 ) { return ans; }

    long long minind = 0;
    for ( long long i = 1 ; i < pts.size() ; i ++ ) {
        if ( pts[minind].y > pts[i].y || ( pts[minind].y == pts[i].y && pts[minind].x > pts[i].x ) ) {
            minind = i;
        }
    }

    swap( pts[ minind ], pts[ 0 ] );
    chcent = pts[0];
    sort( pts.begin()+1, pts.end(), cmpch );

/*
    cout << chcent.x << " " << chcent.y << "\n";
    cout << "sorted: \n";
    for ( long long i = 0 ; i < pts.size() ; i ++ ) {
        cout << pts[i].x << " " << pts[i].y << "\n";
    }
    cout << "\n";
*/

    for ( long long i = 0 ; i < pts.size() ; i ++ ) {

        for ( ; ans.size() >= 2 && cross( ans[ ans.size()-2 ], ans.back(), pts[i] ) >= 0 ; ans.pop_back() ) {}
        ans.push_back( pts[i] );
    }

    /*
    cout <<"hull:\n";
    for ( long long i = 0 ; i < ans.size() ; i ++ ) {
        cout << ans[i].x << " " << ans[i].y << "\n";
    }
    */

    return ans;
}
void generatePoly ( int ind, int sumX, int sumY ) {
    if ( ind == k ) {
        poly.push_back( p( sumX, sumY ) );
        return;
    }
    generatePoly( ind+1, sumX + wx[ind], sumY + wy[ind] );
    generatePoly( ind+1, sumX - wx[ind], sumY - wy[ind] );
}

int sz = 1;

long long xq, numq;
void add ( long long  l = (-1LL<<33), long long  r = ( 1LL<<33 ), int ind = 0 ) {
    if ( l == xq && r == xq+1 ) {
        it[ind].sum += numq;
        return;
    }
    if ( r <= xq || xq+1 <= l ) { return; }

    if ( xq < (l+r)/2 ) {
        if ( it[ind].lind == -1 ) {
            it[sz] = ver();
            it[ind].lind = sz++;
        }
        add( l, (l+r)/2, it[ind].lind );
    }
    else {
        if ( it[ind].rind == -1 ) {
            it[sz] = ver();
            it[ind].rind = sz++;
        }
        add( (l+r)/2, r, it[ind].rind );
    }

    it[ind].sum += numq;

}
long long lq, rq;
long long getSum ( long long  ll = -(1LL<<33), long long rr = (1LL<<33), int ind = 0 ) {
    if ( ind == -1 ) { return 0;}
    if ( lq <= ll && rr <= rq ) { return it[ind].sum; }
    if ( rr <= lq || rq <= ll ) { return 0; }
//    if ( it[ind].lind == -1 ) { return 0; }

    return getSum ( ll, (ll+rr)/2, it[ind].lind ) + getSum ( (ll+rr)/2, rr, it[ind].rind );
}
bool toS = 0;

bool cmpev ( ev a, ev b ) {
    if ( abs( a.y - b.y ) < eps ) {
        if ( a.t == b.t ) { return a.x < b.x; }
        else { return ( a.t > b.t ) ^toS ; }
    }
    return a.y < b.y ;
}
/*

3 4 1
2 0
-1 1
-1 -2
-3 0 6
1 -2 1
-3 -7 3
3 2 2
-1 -4 1

*/

ev v[(1<<20)];
int szv = 0;

void getCnt ( p s, p f, bool isEnd ) {
    if ( s.x == f.x ) { cout <<" wazaa\n"; return ; }

    slope = (f.y-s.y)/(double)(f.x-s.x);
    if ( s.x < f.x ) { toS = 0; }
    else { toS = 1; }

    szv = 0;

    it[0] = ver();
    sz = 1;

    for ( int i = 0 ; i < q ; i ++ ) {
        v[szv++ ] = ev( inputf[i].x + s.x*t[i], inputf[i].y + s.y*t[i], -1, 1, i );
    }
    for ( int i = 0 ; i < n ; i ++ ) {
        v[szv++] = ev ( a[i].x, a[i].y, acnt[i], 0, i ) ;
    }

    sort( v, v+szv, cmpev );

//    cout << s.x << " " << s.y << " : " << f.x << " " << f.y << ": \n";
    for ( int i = 0 ; i < szv ; i ++ ) {

  //      cout << "going for " << v[i].x << " " << v[i].t << "\n";

        if ( v[i].t == 0 ) {

            xq = v[i].x;
            numq = v[i].cnt;
            add ();
        }else {
            int ind = v[i].ind;

            lq = inputf[ind].x + s.x*t[ind];
            rq = inputf[ind].x + f.x*t[ind];

            int coef = -1;
            if ( lq > rq ) { coef = 1; swap( lq, rq ); }
            if ( isEnd ) { rq ++; }

            long long cc = getSum();
//            cout << lq << " " << rq << " recieves -------------> " << cc*coef << "\n";

            anscnt[ind] += cc*coef;
        }

    }
    //cout << "\n\n";

}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> k >> n >> q;
    for ( int i = 0 ; i < k ; i ++ ) {
        cin >> wx[i] >> wy[i];
    }
    generatePoly( 0, 0, 0 );
    poly = getHull( poly );

    /*
    cout << "poly:\n";
    for ( long long i = 0 ; i < poly.size() ; i ++ ) {
        cout << poly[i].x << " " << poly[i].y << "\n";
    }
    cout << "\n";
    */

    for ( int i = 0 ; i < n ; i ++ ) {
        cin >> a[i].x >> a[i].y >> acnt[i];
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cin >> inputf[i].x >> inputf[i].y >> t[i];
    }

    int maxInd = 1;
    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        if ( poly[i].x > poly[maxInd].x ) { maxInd = i; }
    }

    for ( int i = 0 ; i < poly.size() ; i ++ ) {
        getCnt( poly[i], poly[( i+1 )%poly.size() ], (i==maxInd)||( (i+1)%poly.size() == maxInd ) );
    }
    for ( int i = 0 ; i < q ; i ++ ) {
        cout << anscnt[i] << "\n";
    }
    return 0;
}