#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 100000
#define N 131072
#define INF 2000000000
#define eps 1e-6
#define magic 1000000005
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques> q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[1LL*fx[i]*magic+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[1LL*x*magic+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[id].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],GetSlop(s[i].y,s[i].x));
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 200000
#define N 262144
#define INF 2000000000
#define eps 1e-10
#define magic 1010101015LL
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

int Find(int r,double y)
{
	int l=1,res=r+1,mid;
	while(l<=r)
	{
		mid=l+r>>1;
		if(L[mid]>y+eps) res=mid,r=mid-1;
		else l=mid+1;
	}
	return res-1;
}

void Solve(vector<ques> q,int ky,int kx)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(!kx) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-(double)fx[i]*ky/kx;L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=Find(cnt,q[i].y);
			Renew(p,q[i].id);
		}
		else
		{
			int p=Find(cnt,q[i].y);
			if(p>0) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		if(s[i].x==0&&s[i].y<0) s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[magic*fx[i]+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[magic*x+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-3*eps,i,-1});
			v[id].push_back((ques){0,x,c-3*eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],s[i].y,s[i].x);
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 200000
#define N 262144
#define INF 2000000000
#define eps 1e-6
#define pa pair<int,int>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<pa,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

int Find(int r,double y)
{
	int l=1,res=r+1,mid;
	while(l<=r)
	{
		mid=l+r>>1;
		if(L[mid]>y) res=mid,r=mid-1;
		else l=mid+1;
	}
	return res-1;
}

void Solve(vector<ques> q,int ky,int kx)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(!kx) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-(double)fx[i]*ky/kx;L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=Find(cnt,q[i].y);
			Renew(p,q[i].id);
		}
		else
		{
			int p=Find(cnt,q[i].y);
			if(p>0) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		if(s[i].x==0&&s[i].y<0) s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[make_pair(fx[i],fy[i])]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[make_pair(x,y)];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-3*eps,i,-1});
			v[id].push_back((ques){0,x,c-3*eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],s[i].y,s[i].x);
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 200000
#define N 262144
#define INF 2000000000
#define eps 1e-5
#define magic 1010101015LL
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques> q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);int tot=1;
	for(int i=2;i<=cnt;++i) if(fabs(L[i]-L[i-1])>eps) L[++tot]=L[i];cnt=tot;
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p>0) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		if(s[i].x==0&&s[i].y<0) s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[magic*fx[i]+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[magic*x+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[id].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],GetSlop(s[i].y,s[i].x));
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 100000
#define N 131072
#define INF 2000000000
#define eps 1e-6
#define magic 1000000005
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques> q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[(long long)2e9*(fx[i]+1e9)+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[(long long)2e9*(x+1e9)+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[id].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],GetSlop(s[i].y,s[i].x));
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 100000
#define N 131072
#define INF 2000000000
#define eps 1e-11
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx,toty,tot=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind;double x,y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return(double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques>&q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);cnt=unique(L+1,L+cnt+1)-L-1;
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[1LL*fx[i]*(1e9)+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;int top=0;Ans[i]+=num[1LL*x*(1e9)+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-eps,y,i,-1});
				v[id].push_back((ques){0,x-eps,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[id].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],GetSlop(s[i].y,s[i].x));
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 100000
#define N 131072
#define INF 2000000000
#define eps 1e-8
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN*5+5];
map<double,int> mp;map<long long,long long> num;map<int,int> Mp;
int K,n,m,totx,toty,tot=0,fx[MN+5],fy[MN+5],A[MN+5],t[MN+5],cnt=0;
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind;double x,y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return y>0?INF:-INF;else return(double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques>&q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF||k==-INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);cnt=unique(L+1,L+cnt+1)-L-1;
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=K;++i)
		if(!mp[GetSlop(s[i].y,s[i].x)]) mp[GetSlop(s[i].y,s[i].x)]=++tot;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[1LL*fx[i]*(1e9)+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read();
		x-=t*totx;y-=t*toty;int top=0;Ans[i]+=num[1LL*x*(1e9)+y]+num[1LL*(x+totx*t*2)*(1e9)+y+toty*t*2];
		for(int j=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j)
		if(!s[j].x)
		{
			if(s[j].y>0)
			{
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,y+s[j].y*t,i,1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,y,i,-1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x-eps,y+s[j].y*t,i,-1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x-eps,y,i,1});
			}
			else
			{
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,y,i,1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x-eps,y,i,-1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x-eps,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,c,i,1});
			v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(map<double,int>::iterator it=mp.begin();it!=mp.end();++it) Solve(v[it->second],it->first);
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 100000
#define N 131072
#define INF 2000000000
#define eps 1e-11
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx,toty,tot=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return(double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques>&q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);cnt=unique(L+1,L+cnt+1)-L-1;
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[1LL*fx[i]*(1e9)+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[1LL*x*(1e9)+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-5*eps,i,-1});
			v[id].push_back((ques){0,x,c-5*eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],GetSlop(s[i].y,s[i].x));
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 200000
#define N 262144
#define INF 2000000000
#define eps 1e-5
#define magic 1010101015LL
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques> q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p>0) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[magic*fx[i]+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[magic*x+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[id].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],GetSlop(s[i].y,s[i].x));
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 100000
#define N 131072
#define INF 2000000000
#define eps 1e-11
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx,toty,tot=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind;double x,y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return(double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques>&q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);cnt=unique(L+1,L+cnt+1)-L-1;
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[1LL*fx[i]*(1e9)+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;int top=0;Ans[i]+=num[1LL*x*(1e9)+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%K+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-eps,y,i,-1});
				v[id].push_back((ques){0,x-eps,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[id].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],GetSlop(s[i].y,s[i].x));
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 200000
#define N 262144
#define INF 2000000000
#define eps 1e-8
#define magic 1010101015LL
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

int Find(int r,double y)
{
	int l=1,res=r+1,mid;
	while(l<=r)
	{
		mid=l+r>>1;
		if(L[mid]>y) res=mid,r=mid-1;
		else l=mid+1;
	}
	return res-1;
}

void Solve(vector<ques> q,int ky,int kx)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(!kx) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-(double)fx[i]*ky/kx;L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=Find(cnt,q[i].y);
			Renew(p,q[i].id);
		}
		else
		{
			int p=Find(cnt,q[i].y);
			if(p>0) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		if(s[i].x==0&&s[i].y<0) s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[magic*fx[i]+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[magic*x+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-3*eps,i,-1});
			v[id].push_back((ques){0,x,c-3*eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],s[i].y,s[i].x);
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 100000
#define N 131072
#define INF 2000000000
#define eps 1e-8
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN*5+5];
map<double,int> mp;map<long long,long long> num;map<int,int> Mp;
int K,n,m,totx,toty,tot=0,fx[MN+5],fy[MN+5],A[MN+5],t[MN+5],cnt=0;
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind;double x,y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return(double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

void Solve(vector<ques>&q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);cnt=unique(L+1,L+cnt+1)-L-1;
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=lower_bound(L+1,L+cnt+1,q[i].y)-L;
			Renew(p,q[i].id);
		}
		else
		{
			int p=upper_bound(L+1,L+cnt+1,q[i].y)-L-1;
			if(p) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=K;++i)
		if(!mp[GetSlop(s[i].y,s[i].x)]) mp[GetSlop(s[i].y,s[i].x)]=++tot;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[1LL*fx[i]*(1e9)+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read();
		x-=t*totx;y-=t*toty;int top=0;Ans[i]+=num[1LL*x*(1e9)+y];
		for(int j=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,y,i,1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x-eps,y,i,-1});
				v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x-eps,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,c,i,1});
			v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[mp[GetSlop(s[j].y,s[j].x)]].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(map<double,int>::iterator it=mp.begin();it!=mp.end();++it) Solve(v[it->second],it->first);
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 200000
#define N 262144
#define INF 2000000000
#define eps 1e-7
#define pa pair<int,int>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<pa,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

int Find(int r,double y)
{
	int l=1,res=r+1,mid;
	while(l<=r)
	{
		mid=l+r>>1;
		if(L[mid]>y+eps) res=mid,r=mid-1;
		else l=mid+1;
	}
	return res-1;
}

void Solve(vector<ques> q,int ky,int kx)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(!kx) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-(double)fx[i]*ky/kx;L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=Find(cnt,q[i].y);
			Renew(p,q[i].id);
		}
		else
		{
			int p=Find(cnt,q[i].y);
			if(p>0) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		if(s[i].x==0&&s[i].y<0) s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[make_pair(fx[i],fy[i])]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[make_pair(x,y)];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-3*eps,i,-1});
			v[id].push_back((ques){0,x,c-3*eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],s[i].y,s[i].x);
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 200000
#define N 262144
#define INF 2000000000
#define eps 1e-8
#define magic 1010101015LL
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<long long,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

int Find(int r,double y)
{
	int l=1,res=r+1,mid;
	while(l<=r)
	{
		mid=l+r>>1;
		if(L[mid]>y) res=mid,r=mid-1;
		else l=mid+1;
	}
	return res-1;
}

void Solve(vector<ques> q,double k)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(k==INF) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-k*fx[i];L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=Find(cnt,q[i].y);
			Renew(p,q[i].id);
		}
		else
		{
			int p=Find(cnt,q[i].y);
			if(p>0) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		if(s[i].x==0&&s[i].y<0) s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[magic*fx[i]+fy[i]]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[magic*x+y];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-eps,i,-1});
			v[id].push_back((ques){0,x,c-eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],GetSlop(s[i].y,s[i].x));
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<map>
#define MN 200000
#define N 262144
#define INF 2000000000
#define eps 1e-7
#define pa pair<int,int>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double L[MN+5];map<pa,long long> num;
int K,n,m,totx=0,toty=0,fx[MN+5],fy[MN+5],A[MN+5];
long long Ans[MN+5],T[N*2+5];
struct vec{int x,y;double slop;}s[25];
bool cmps(const vec&a,const vec&b){return a.slop<b.slop;}
struct ques{int kind,x;double y;int id,ad;};
vector<ques> v[11];
inline double GetSlop(int y,int x){if(!x)return INF;else return (double)y/x;}
bool cmp(const ques&a,const ques&b){return a.x==b.x?a.kind>b.kind:a.x<b.x;}
void Renew(int x,int y){for(T[x+=N]+=y,x>>=1;x;x>>=1) T[x]=T[x<<1]+T[x<<1|1];}
long long Query(int l,int r)
{
	long long sum=0;
	for(l+=N-1,r+=N+1;l^r^1;l>>=1,r>>=1)
	{
		if(~l&1) sum+=T[l+1];
		if( r&1) sum+=T[r-1];
	}
	return sum;
}

int Find(int r,double y)
{
	int l=1,res=r+1,mid;
	while(l<=r)
	{
		mid=l+r>>1;
		if(L[mid]>y) res=mid,r=mid-1;
		else l=mid+1;
	}
	return res-1;
}

void Solve(vector<ques> q,int ky,int kx)
{
//	cout<<"Solve"<<k<<endl;
	int cnt=0;memset(T,0,sizeof(T));
	for(int i=1;i<=n;++i)
		if(!kx) q.push_back((ques){1,fx[i],fy[i],A[i],0}),L[++cnt]=fy[i];
		else
		{
			double c=(double)fy[i]-(double)fx[i]*ky/kx;L[++cnt]=c;
			q.push_back((ques){1,fx[i],c,A[i],0});
		}
	sort(q.begin(),q.end(),cmp);
//	for(int i=0;i<q.size();++i) printf("%d %.8lf %.8lf %d %d\n",q[i].kind,q[i].x,q[i].y,q[i].id,q[i].ad);
	sort(L+1,L+cnt+1);
	for(int i=0;i<q.size();++i)
		if(q[i].kind)
		{
			int p=Find(cnt,q[i].y);
			Renew(p,q[i].id);
		}
		else
		{
			int p=Find(cnt,q[i].y);
			if(p>0) Ans[q[i].id]+=q[i].ad*Query(1,p);
		}
}

int main()
{
	K=read();n=read();m=read();
	for(int i=1;i<=K;++i)
	{
		s[i].x=read(),s[i].y=read();
		if(s[i].x<0) s[i].x=-s[i].x,s[i].y=-s[i].y;
		if(s[i].x==0&&s[i].y<0) s[i].y=-s[i].y;
		totx+=s[i].x,toty+=s[i].y,s[i].x<<=1,s[i].y<<=1;
	}
	for(int i=1;i<=K;++i) s[i].slop=atan2(s[i].y,s[i].x);
	sort(s+1,s+K+1,cmps);
	for(int i=1;i<=K;++i) s[i+K].x=-s[i].x,s[i+K].y=-s[i].y;K<<=1;
	for(int i=1;i<=n;++i)
		fx[i]=read(),fy[i]=read(),A[i]=read(),num[make_pair(fx[i],fy[i])]+=A[i];
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),t=read(),id;
		x-=t*totx;y-=t*toty;Ans[i]+=num[make_pair(x,y)];
		for(int j=1,id=1;j<=K;x+=s[j].x*t,y+=s[j].y*t,++j,id=(j-1)%(K>>1)+1)
		if(!s[j].x)
		{
			if(s[j].y<0)
			{
				v[id].push_back((ques){0,x,y,i,1});
				v[id].push_back((ques){0,x,y+s[j].y*t,i,-1});
				v[id].push_back((ques){0,x-1,y,i,-1});
				v[id].push_back((ques){0,x-1,y+s[j].y*t,i,1});
			}
		}
		else if(s[j].x<0)
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x,c,i,1});
			v[id].push_back((ques){0,x+s[j].x*t,c,i,-1});
		}
		else
		{
			double c=y-(double)x*s[j].y/s[j].x;
			v[id].push_back((ques){0,x+s[j].x*t,c-3*eps,i,-1});
			v[id].push_back((ques){0,x,c-3*eps,i,1});
		}
	}
	for(int i=1;i<=K>>1;++i) Solve(v[i],s[i].y,s[i].x);
	for(int i=1;i<=m;++i) printf("%lld\n",Ans[i]);
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if (x < y) x = y; }

struct P {
	typedef int T; typedef ll T2;	//T2は{a*b | a:T, b:T}を含むタイプ
	T x, y;
	P(T x_, T y_) : x(x_), y(y_) {}
	P() : x(0), y(0) {}
};
inline bool operator==(const P& a, const P& b) { return a.x == b.x && a.y == b.y; }
inline bool operator<(const P& a, const P& b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }
inline P operator+(const P& a, const P& b) { return P(a.x + b.x, a.y + b.y); }
inline P operator-(const P& a, const P& b) { return P(a.x - b.x, a.y - b.y); }
inline P operator-=(P& a, const P& b) { a.x -= b.x, a.y -= b.y; return a; }
inline P::T2 cross(const P& a, const P& b) { return (P::T2)a.x*b.y - (P::T2)a.y*b.x; }
inline P::T2 dot(const P& a, const P& b) { return (P::T2)a.x*b.x + (P::T2)a.y*b.y; }
inline P::T2 norm(const P& a) { return (P::T2)a.x*a.x + (P::T2)a.y*a.y; }
ostream& operator<<(ostream& out, const P& x) { out << "(" << x.x << ", " << x.y << ")"; return out; }

inline int ccw(const P& a, const P& b, const P& c) {
	int ax = b.x - a.x, ay = b.y - a.y, bx = c.x - a.x, by = c.y - a.y;
	P::T2 t = (P::T2)ax*by - (P::T2)ay*bx;
	if (t > 0) return 1;
	if (t < 0) return -1;
	if ((P::T2)ax*bx + (P::T2)ay*by < 0) return +2;
	if ((P::T2)ax*ax + (P::T2)ay*ay < (P::T2)bx*bx + (P::T2)by*by) return -2;
	return 0;
}

vector<P> convex_hull(vector<P> ps) {
	if ((int)ps.size() <= 1) return ps;
	int n = ps.size(), k = 0;
	sort(ps.begin(), ps.end());
	vector<P> ch(2 * n);
	for (int i = 0; i < n; ch[k++] = ps[i++]) // lower-hull
		while (k >= 2 && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
	for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = ps[i--]) // upper-hull
		while (k >= t && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
	ch.resize(k - 1);
	return ch;
}

struct FenwickTree {
	typedef ll T;
	vector<T> v;
	void init(int n) { v.assign(n, T()); }
	void add(int i, T x) {
		for (; i < (int)v.size(); i |= i + 1) v[i] += x;
	}
	T sum(int i) const {	//[0, i)
		T r = T();
		for (-- i; i >= 0; i = (i & (i + 1)) - 1) r += v[i];
		return r;
	}
	T sum(int left, int right) const {	//[left, right)
		return sum(right) - sum(left);
	}
};

#define all(o) (o).begin(), (o).end()

template<typename T, typename V>
void twoDimensionalSumQuery(vector<pair<pair<T, T>, V> > points, vector<pair<pair<T, T>, pair<V, int> > > queries, vector<V> &ans) {
	int n = points.size(), m = queries.size();
	vector<T> positions;
	rep(i, n) positions.push_back(points[i].first.second);
	sort(all(positions));
	positions.erase(unique(all(positions)), positions.end());
	int p = positions.size();
	FenwickTree t; t.init(p);
	sort(all(points)); sort(all(queries));
	int left = 0;
	rep(i, m) {
		T x = queries[i].first.first;
		while (left < n && points[left].first.first < x) {
			int j = lower_bound(all(positions), points[left].first.second) - positions.begin();
			t.add(j, points[left].second);
			left ++;
		}
		int y = lower_bound(all(positions), queries[i].first.second) - positions.begin();
		ans[queries[i].second.second] += t.sum(y) * queries[i].second.first;
	}
}

bool contains(const vector<P>& o, const P& p) {
	bool in = false;
	for (int i = 0; i < (int)o.size(); ++i) {
		P a = o[i] - p, b = o[(i + 1) % o.size()] - p;
		if (a.y > b.y) swap(a, b);
		if (a.y <= 0 && 0 < b.y)
			if (cross(a, b) < 0) in = !in;
		if (cross(a, b) == 0 && dot(a, b) <= 0) return true;	//point on edge
	}
	return in;
}

template<typename T, typename U>
inline auto floordiv(T x, U y) -> decltype(x / y) {
	auto q = x / y, r = x % y;
	return q - ((r != 0) & ((r<0) ^ (y<0)));
}
int main() {
	int K; int N; int Q;
	while (~scanf("%d%d%d", &K, &N, &Q)) {
		vector<P> poly = { P(0, 0) };
		rep(i, K) {
			int wx; int wy;
			scanf("%d%d", &wx, &wy);
			P w(wx, wy);
			vector<P> ps;
			for (auto p : poly) {
				ps.push_back(p + w);
				ps.push_back(p - w);
			}
			poly = convex_hull(ps);
		}
		if (poly.size() <= 2)continue;
		vector<pair<P, int>> points(N);
		rep(i, N) {
			int x; int y; int a;
			scanf("%d%d%d", &x, &y, &a);
			points[i] = { P(x,y),a };
		}
		vector<vector<pair<pair<ll, ll>, ll>>> qPoints(poly.size());
		rep(i, poly.size()) {
			auto from = poly[i], to = poly[(i + 1) % poly.size()];
			if (from.x == to.x) continue;
			int dx = abs(from.x - to.x), dy = to.y - from.y;
			int xL = from.x, xR = to.x, yL = from.y, yR = to.y;
			if (xL > xR) {
				dy = -dy;
				swap(xL, xR);
				swap(yL, yR);
			}
			for (auto pa : points) {
				auto p = pa.first;
				ll val = (ll)p.y * dx - (ll)p.x * dy;
				qPoints[i].emplace_back(make_pair(p.x, val), pa.second);
			}
		}
		int maxX = -INF;
		for (auto p : poly)
			amax(maxX, p.x);
		vector<vector<pair<pair<ll, ll>, pair<ll, int>>>> qQueries(poly.size());
		vector<pair<P, int>> naivequeries(Q);
		rep(qi, Q) {
			int ex; int ey; int t;
			scanf("%d%d%d", &ex, &ey, &t);
			P e(ex, ey);
			rep(i, poly.size()) {
				auto from = poly[i], to = poly[(i + 1) % poly.size()];
				if (from.x == to.x) continue;
				int dx = abs(from.x - to.x), dy = to.y - from.y;
				int sign = from.x > to.x ? 1 : -1;
				int xL = from.x, xR = to.x, yL = from.y, yR = to.y;
				if (xL > xR) {
					dy = -dy;
					swap(xL, xR);
					swap(yL, yR);
				}
				bool isMaxX = xR == maxX;
				xL = xL * t + ex;
				xR = xR * t + ex;
				yL = yL * t + ey;
				if (isMaxX) ++ xR;
				ll bound = (ll)yL * dx - (ll)xL * dy;
				if (sign == 1) ++ bound;
				qQueries[i].emplace_back(make_pair(xR, bound), make_pair(+sign, qi));
				qQueries[i].emplace_back(make_pair(xL, bound), make_pair(-sign, qi));
			}
			naivequeries[qi] = { e,t };
		}
		vector<ll> ans(Q, 0LL);
		rep(i, poly.size())
			twoDimensionalSumQuery(qPoints[i], qQueries[i], ans);
		for (int i = 0; i < (int)ans.size(); ++ i) {
			printf("%lld\n", ans[i]);
		}
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if (x < y) x = y; }

struct P {
	typedef int T; typedef ll T2;	//T2?{a*b | a:T, b:T}??????
	T x, y;
	P(T x_, T y_) : x(x_), y(y_) {}
	P() : x(0), y(0) {}
};
inline bool operator==(const P& a, const P& b) { return a.x == b.x && a.y == b.y; }
inline bool operator<(const P& a, const P& b) { return a.x < b.x || (a.x == b.x && a.y < b.y); }
inline P operator+(const P& a, const P& b) { return P(a.x + b.x, a.y + b.y); }
inline P operator-(const P& a, const P& b) { return P(a.x - b.x, a.y - b.y); }
inline P operator-=(P& a, const P& b) { a.x -= b.x, a.y -= b.y; return a; }
inline P::T2 cross(const P& a, const P& b) { return (P::T2)a.x*b.y - (P::T2)a.y*b.x; }
inline P::T2 dot(const P& a, const P& b) { return (P::T2)a.x*b.x + (P::T2)a.y*b.y; }
inline P::T2 norm(const P& a) { return (P::T2)a.x*a.x + (P::T2)a.y*a.y; }
ostream& operator<<(ostream& out, const P& x) { out << "(" << x.x << ", " << x.y << ")"; return out; }

inline int ccw(const P& a, const P& b, const P& c) {
	int ax = b.x - a.x, ay = b.y - a.y, bx = c.x - a.x, by = c.y - a.y;
	P::T2 t = (P::T2)ax*by - (P::T2)ay*bx;
	if (t > 0) return 1;
	if (t < 0) return -1;
	if ((P::T2)ax*bx + (P::T2)ay*by < 0) return +2;
	if ((P::T2)ax*ax + (P::T2)ay*ay < (P::T2)bx*bx + (P::T2)by*by) return -2;
	return 0;
}

vector<P> convex_hull(vector<P> ps) {
	if ((int)ps.size() <= 1) return ps;
	int n = ps.size(), k = 0;
	sort(ps.begin(), ps.end());
	vector<P> ch(2 * n);
	for (int i = 0; i < n; ch[k++] = ps[i++]) // lower-hull
		while (k >= 2 && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
	for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = ps[i--]) // upper-hull
		while (k >= t && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
	ch.resize(k - 1);
	return ch;
}

struct FenwickTree {
	typedef ll T;
	vector<T> v;
	void init(int n) { v.assign(n, T()); }
	void add(int i, T x) {
		for (; i < (int)v.size(); i |= i + 1) v[i] += x;
	}
	T sum(int i) const {	//[0, i)
		T r = T();
		for (-- i; i >= 0; i = (i & (i + 1)) - 1) r += v[i];
		return r;
	}
	T sum(int left, int right) const {	//[left, right)
		return sum(right) - sum(left);
	}
};

#define all(o) (o).begin(), (o).end()

template<typename T, typename V>
void twoDimensionalSumQuery(vector<pair<pair<T, T>, V> > points, vector<pair<pair<T, T>, pair<V, int> > > queries, vector<V> &ans) {
	int n = points.size(), m = queries.size();
	vector<T> positions;
	rep(i, n) positions.push_back(points[i].first.second);
	sort(all(positions));
	positions.erase(unique(all(positions)), positions.end());
	int p = positions.size();
	FenwickTree t; t.init(p);
	sort(all(points)); sort(all(queries));
	int left = 0;
	rep(i, m) {
		T x = queries[i].first.first;
		while (left < n && points[left].first.first < x) {
			int j = lower_bound(all(positions), points[left].first.second) - positions.begin();
			t.add(j, points[left].second);
			left ++;
		}
		int y = lower_bound(all(positions), queries[i].first.second) - positions.begin();
		ans[queries[i].second.second] += t.sum(y) * queries[i].second.first;
	}
}

bool contains(const vector<P>& o, const P& p) {
	bool in = false;
	for (int i = 0; i < (int)o.size(); ++i) {
		P a = o[i] - p, b = o[(i + 1) % o.size()] - p;
		if (a.y > b.y) swap(a, b);
		if (a.y <= 0 && 0 < b.y)
			if (cross(a, b) < 0) in = !in;
		if (cross(a, b) == 0 && dot(a, b) <= 0) return true;	//point on edge
	}
	return in;
}

template<typename T, typename U>
inline auto floordiv(T x, U y) -> decltype(x / y) {
	auto q = x / y, r = x % y;
	return q - ((r != 0) & ((r<0) ^ (y<0)));
}
int main() {
	int K; int N; int Q;
	while (~scanf("%d%d%d", &K, &N, &Q)) {
		vector<P> poly = { P(0, 0) };
		rep(i, K) {
			int wx; int wy;
			scanf("%d%d", &wx, &wy);
			P w(wx, wy);
			vector<P> ps;
			for (auto p : poly) {
				ps.push_back(p + w);
				ps.push_back(p - w);
			}
			poly = convex_hull(ps);
		}
		if (poly.size() <= 2)continue;
		vector<pair<P, int>> points(N);
		rep(i, N) {
			int x; int y; int a;
			scanf("%d%d%d", &x, &y, &a);
			points[i] = { P(x,y),a };
		}
		vector<vector<pair<pair<ll, ll>, ll>>> qPoints(poly.size());
		rep(i, poly.size()) {
			auto from = poly[i], to = poly[(i + 1) % poly.size()];
			if (from.x == to.x) continue;
			int dx = abs(from.x - to.x), dy = to.y - from.y;
			int xL = from.x, xR = to.x, yL = from.y, yR = to.y;
			if (xL > xR) {
				dy = -dy;
				swap(xL, xR);
				swap(yL, yR);
			}
			for (auto pa : points) {
				auto p = pa.first;
				ll val = (ll)p.y * dx - (ll)p.x * dy;
				qPoints[i].emplace_back(make_pair(p.x, val), pa.second);
			}
		}
		int maxX = -INF;
		for (auto p : poly)
			amax(maxX, p.x);
		vector<vector<pair<pair<ll, ll>, pair<ll, int>>>> qQueries(poly.size());
		vector<pair<P, int>> naivequeries(Q);
		rep(qi, Q) {
			int ex; int ey; int t;
			scanf("%d%d%d", &ex, &ey, &t);
			P e(ex, ey);
			rep(i, poly.size()) {
				auto from = poly[i], to = poly[(i + 1) % poly.size()];
				if (from.x == to.x) continue;
				int dx = abs(from.x - to.x), dy = to.y - from.y;
				int sign = from.x > to.x ? 1 : -1;
				int xL = from.x, xR = to.x, yL = from.y, yR = to.y;
				if (xL > xR) {
					dy = -dy;
					swap(xL, xR);
					swap(yL, yR);
				}
				bool isMaxX = xR == maxX;
				xL = xL * t + ex;
				xR = xR * t + ex;
				yL = yL * t + ey;
				if (isMaxX) ++ xR;
				ll bound = (ll)yL * dx - (ll)xL * dy;
				if (sign == 1) ++ bound;
				qQueries[i].emplace_back(make_pair(xR, bound), make_pair(+sign, qi));
				qQueries[i].emplace_back(make_pair(xL, bound), make_pair(-sign, qi));
			}
			naivequeries[qi] = { e,t };
		}
		vector<ll> ans(Q, 0LL);
		rep(i, poly.size())
			twoDimensionalSumQuery(qPoints[i], qQueries[i], ans);
		for (int i = 0; i < (int)ans.size(); ++ i) {
			printf("%lld\n", ans[i]);
		}
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#define MAXN 100010
#define MAXK 10

using namespace std;

struct point {
    long long x,y;
    point() {}
    point(long long x, long long y) : x(x), y(y) {}

    point operator + (point p) { return point(x+p.x, y+p.y); }
    point operator - (point p) { return point(x-p.x, y-p.y); }
    point operator * (long long a) { return point(a*x, a*y); }

    bool operator < (point p) const {
        if (x != p.x) return x < p.x;
        return y < p.y;
    }
    bool operator == (point p) const {
        return x == p.x && y == p.y;
    }
};

long long cross(point a, point b) {
    return a.x * b.y - a.y * b.x;
}

int k,n,q;
point v[MAXK],f[MAXN],p[MAXN];
int a[MAXN],t[MAXN];
long long ans[MAXN];

vector<point> m_points;

void gen_points(int i, point x) {
    if (i == k) {
        m_points.push_back(x);
        return;
    }
    gen_points(i + 1, x + v[i]);
    gen_points(i + 1, x - v[i]);
}

vector<point> uh, lh;
void minkowski() {
    gen_points(0, point(0, 0));
    sort(m_points.begin(), m_points.end());
    m_points.erase(unique(m_points.begin(), m_points.end()), m_points.end());

    for (point &p : m_points) {
        while (uh.size() > 1) {
            point a = uh[uh.size()-2], b = uh.back();
            if (cross(p-a,b-a) > 0) break;
            uh.pop_back();
        }
        uh.push_back(p);
    }

    for (point &p : m_points) {
        while (lh.size() > 1) {
            point a = lh[lh.size()-2], b = lh.back();
            if (cross(b-a,p-a) > 0) break;
            lh.pop_back();
        }
        lh.push_back(p);
    }
}

struct event {
    long long y;
    int op, i;
    event(long long y, int op, int i) : y(y), op(op), i(i) {};

    bool operator < (const event& e) const {
        if (y != e.y) return y < e.y;
        return op < e.op;
    }
};

long long num[MAXN];
long long l[MAXN],r[MAXN],x[MAXN];
long long bit[3*MAXN];

void add(int x, long long val) {
    for (; x < 3*MAXN; x += x & -x) bit[x] += val;
}

long long get(int x) {
    long long res = 0;
    for (; x > 0; x -= x & -x) res += bit[x];
    return res;
}

void go(point u, point v, bool incr, bool inctop) {
    point e = v - u;
    vector<event> events;
    vector<long long> cx;
    for (int i = 0; i < q; i++) {
        long long y = cross(e, p[i] + u * t[i]);
        if (e.x == 0) {
            if (inctop) y = p[i].y + t[i] * max(u.y, v.y);
            else y = p[i].y + t[i] * min(u.y, v.y) - 1;
        } else if (!inctop) y--;
        events.push_back(event(y, 1, i));
        l[i] = p[i].x + t[i] * u.x;
        r[i] = p[i].x + t[i] * v.x - 1;
        if (incr) r[i]++;
        cx.push_back(l[i]);
        cx.push_back(r[i]);
    }
    for (int i = 0; i < n; i++) {
        long long y = cross(e, f[i]);
        if (e.x == 0) y = f[i].y;
        events.push_back(event(y, 0, i));
        x[i] = f[i].x;
        cx.push_back(x[i]);
    }

    sort(cx.begin(), cx.end());
    cx.erase(unique(cx.begin(), cx.end()), cx.end());
    for (int i = 0; i < q; i++) {
        l[i] = upper_bound(cx.begin(), cx.end(), l[i]) - cx.begin();
        r[i] = upper_bound(cx.begin(), cx.end(), r[i]) - cx.begin();
    }
    for (int i = 0 ; i < n; i++) {
        x[i] = upper_bound(cx.begin(), cx.end(), x[i]) - cx.begin();
    }

    memset(bit,0,sizeof(bit));
    sort(events.begin(), events.end());
    for (auto &ev : events) {
        int i = ev.i;
        if (ev.op == 1) {
            num[i] = get(r[i]) - get(l[i] - 1);
        } else {
            add(x[i], a[i]);
        }
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin >> k >> n >> q;
    for (int i = 0; i < k; i++) {
        cin >> v[i].x >> v[i].y;
    }

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

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

    minkowski();

    for (int i = 0; i + 1 < uh.size(); i++) {
        go(uh[i], uh[i + 1], i + 2 == uh.size(), 1);
        //cerr << uh[i].x << "," << uh[i].y << " -> " << uh[i+1].x << "," << uh[i+1].y << endl;
        for (int j = 0; j < q; j++) {
            ans[j] += num[j];
            //cerr << num[j] << endl;
        }
    }
    for (int i = 0; i + 1 < lh.size(); i++) {
        go(lh[i], lh[i + 1], i + 2 == lh.size(), 0);
        //cerr << lh[i].x << "," << lh[i].y << " -> " << lh[i+1].x << "," << lh[i+1].y << endl;
        for (int j = 0; j < q; j++) {
            ans[j] -= num[j];
            //cerr << -num[j] << endl;
        }
    }

    for (int i = 0; i < q; i++) {
        cout << ans[i] << '\n';
    }
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>
#include<math.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (const pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (const pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

li ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	li maxx = v[0].x;
	for (int i = 0; i < 2 * k; ++i)
		maxx = max(maxx, v[i].x);

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x == v[_j].x)
			sig[_i] = 0;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<li, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a;
		if (l.b < 0)
			l.b *= -1, c *= -1;

		if (v[_i].x == v[_j].x)
			continue;

		for (int i = 0; i < n; ++i) {
			li cy = P[i].y * l.b - P[i].x * c;
			if (sig[_i] == -1)
				cy++;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			li cy = p.y * l.b - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<li, int> & a, const pair<li, int> & b) {
			if (a.first != b.first)
				return a.first < b.first;
			return a.second < b.second;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (v[_i].x != maxx && v[_j].x != maxx)
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%I64d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>
#include<math.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (const pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (const pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

li ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<ld, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a / ld(l.b);
		if (v[_i].x == v[_j].x)
			continue;
		ld add = -1e-9;
		if (v[_i].x < v[_j].x)
			add = 1e-9;

		for (int i = 0; i < n; ++i) {
			ld cy = P[i].y - P[i].x * c + add;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			ld cy = p.y - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<ld, int> & a, const pair<ld, int> & b) {
			return a.first < b.first;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (sig[_i] == -1 && sig[_i] == sig[_j])
					r--;
				if (sig[_i] == 1 && sig[_i] == sig[(_i - 1 + 2 * k) % (2 * k)])
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%I64d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>
#include<math.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (const pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (const pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

li ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	li maxx = v[0].x;
	for (int i = 0; i < 2 * k; ++i)
		maxx = max(maxx, v[i].x);

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x == v[_j].x)
			sig[_i] = 0;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<ld, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a / ld(l.b);
		if (v[_i].x == v[_j].x)
			continue;
		ld add = 1e-6;
		if (v[_i].x < v[_j].x)
			add = 1e-6;

		for (int i = 0; i < n; ++i) {
			ld cy = P[i].y - P[i].x * c + add;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			ld cy = p.y - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<ld, int> & a, const pair<ld, int> & b) {
			return a.first < b.first;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (v[_i].x != maxx && v[_j].x != maxx)
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%I64d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>
#include<math.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (const pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (const pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

li ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	li maxx = v[0].x;
	for (int i = 0; i < 2 * k; ++i)
		maxx = max(maxx, v[i].x);

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x == v[_j].x)
			sig[_i] = 0;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<ld, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a / ld(l.b);
		if (v[_i].x == v[_j].x)
			continue;
		ld add = 1e-9;
		if (v[_i].x < v[_j].x)
			add = 1e-9;

		for (int i = 0; i < n; ++i) {
			ld cy = P[i].y - P[i].x * c + add;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			ld cy = p.y - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<ld, int> & a, const pair<ld, int> & b) {
			return a.first < b.first;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (v[_i].x != maxx && v[_j].x != maxx)
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%I64d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>
#include<math.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (const pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (const pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

li ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	li maxx = v[0].x;
	for (int i = 0; i < 2 * k; ++i)
		maxx = max(maxx, v[i].x);

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x == v[_j].x)
			sig[_i] = 0;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<ld, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a / ld(l.b);
		if (v[_i].x == v[_j].x)
			continue;
		ld add = -1e-8;
		if (v[_i].x < v[_j].x)
			add = 1e-8;

		for (int i = 0; i < n; ++i) {
			ld cy = P[i].y - P[i].x * c + add;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			ld cy = p.y - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<ld, int> & a, const pair<ld, int> & b) {
			return a.first < b.first;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (v[_i].x != maxx && v[_j].x != maxx)
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%I64d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

int ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<ld, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a / ld(l.b);
		if (v[_i].x == v[_j].x)
			continue;
		ld add = -1e-9;
		if (v[_i].x < v[_j].x)
			add = 1e-9;

		for (int i = 0; i < n; ++i) {
			ld cy = P[i].y - P[i].x * c + add;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			ld cy = p.y - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<ld, int> & a, const pair<ld, int> & b) {
			return a.first < b.first;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (sig[_i] == -1 && sig[_i] == sig[_j])
					r--;
				if (sig[_i] == 1 && sig[_i] == sig[(_i - 1 + 2 * k) % (2 * k)])
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>
#include<math.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (const pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (const pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

li ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	li maxx = v[0].x;
	for (int i = 0; i < 2 * k; ++i)
		maxx = max(maxx, v[i].x);

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x == v[_j].x)
			sig[_i] = 0;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<ld, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a / ld(l.b);
		if (v[_i].x == v[_j].x)
			continue;
		ld add = -1e-11;
		if (v[_i].x < v[_j].x)
			add = 1e-11;

		for (int i = 0; i < n; ++i) {
			ld cy = P[i].y - P[i].x * c + add;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			ld cy = p.y - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<ld, int> & a, const pair<ld, int> & b) {
			return a.first < b.first;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (v[_i].x != maxx && v[_j].x != maxx)
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%I64d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>
#include<math.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (const pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (const pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

li ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	li maxx = v[0].x;
	for (int i = 0; i < 2 * k; ++i)
		maxx = max(maxx, v[i].x);

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x == v[_j].x)
			sig[_i] = 0;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<ld, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a / ld(l.b);
		if (v[_i].x == v[_j].x)
			continue;
		ld add = -1e-10;
		if (v[_i].x < v[_j].x)
			add = 1e-10;

		for (int i = 0; i < n; ++i) {
			ld cy = P[i].y - P[i].x * c + add;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			ld cy = p.y - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<ld, int> & a, const pair<ld, int> & b) {
			return a.first < b.first;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (v[_i].x != maxx && v[_j].x != maxx)
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%I64d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<vector>
#include<set>
#include<algorithm>
#include<iostream>
#include<ctime>
#include<iomanip>
#include<cassert>
#include<memory>
#include<string>
#include<string.h>
#include<math.h>

using namespace std;

typedef double ld;
typedef long long li;

struct pt {
	li x, y;
	pt(li x, li y) : x(x), y(y) {}
	pt() : x(0), y(0) {}
	void read() {
		scanf("%I64d%I64d", &x, &y);
	}
	pt operator + (const pt & a) {
		return pt(a.x + x, a.y + y);
	}

	pt operator - (const pt & a) {
		return pt(x - a.x, y - a.y);
	}

	pt operator * (ld k) {
		return pt(x * k, y * k);
	}

};

struct line {
	li a, b, c;
	line(pt & p, pt & q) {
		a = p.y - q.y;
		b = q.x - p.x;
		c = -(a * p.x + b * p.y);
	}
};

ld ang(const pt & p) {
	return atan2(p.y, p.x);
}

int k, n, q;
const int N = 500 * 1000 + 5;
pt EV[N];
pt P[N];
pt V[N];
int T[N];
int CNT[N];

pt v[N];

bool cmp(const pt & a, const pt & b) {
	return ang(a) < ang(b);
}

void read() {
	scanf("%d%d%d", &k, &n, &q);
	for (int i = 0; i < k; ++i)
		V[i].read();
	for (int i = 0; i < n; ++i) {
		P[i].read();
		scanf("%d", &CNT[i]);
	}
	for (int i = 0; i < q; ++i) {
		EV[i].read();
		scanf("%d", &T[i]);
	}
}

li ans[N];

li f[N];

void inc(int pos, int d) {
	for (; pos < N; pos |= pos + 1)
		f[pos] += d;
}

li get(int pos) {
	li res = 0;
	for (; pos >= 0; pos = (pos & (pos + 1)) - 1)
		res += f[pos];
	return res;
}

li get(int l, int r) {
	return get(r) - get(l - 1);
}

ld PI = 3.1415926535897932384626433832795;

void solve() {
	for (int i = 0; i < k; ++i)
	{
		V[i] = V[i] * 2;
		V[i + k] = V[i] * -1;
	}
	sort(V, V + 2 * k, cmp);

	v[0] = pt(0, 0);
	for (int i = 1; i < 2 * k; ++i)
		v[i] = v[i - 1] + V[i - 1];
	pt c(0, 0);
	for (int i = 0; i < 2 * k; ++i)
		c = c + v[i];
	c = c * (1 / (2.0 * k));

	for (int i = 0; i < 2 * k; ++i)
		v[i] = v[i] - c;

	int sig[33];

	for (int _i = 0; _i < 2 * k; ++_i) {
		int _j = (_i + 1) % (2 * k);
		sig[_i] = 1;
		if (v[_i].x == v[_j].x)
			sig[_i] = 0;
		if (v[_i].x < v[_j].x)
			sig[_i] = -1;
	}

	for (int _i = 0; _i < 2 * k; ++_i) {
		vector<pair<ld, int> > ev;
		vector <li> xs;
		memset(f, 0, sizeof f);

		int _j = (_i + 1) % (2 * k);
		line l(v[_i], v[_j]);
		ld c = -l.a / ld(l.b);
		if (v[_i].x == v[_j].x)
			continue;
		ld add = -1e-9;
		if (v[_i].x < v[_j].x)
			add = 1e-9;

		for (int i = 0; i < n; ++i) {
			ld cy = P[i].y - P[i].x * c + add;
			ev.push_back(make_pair(cy, i));
			xs.push_back(P[i].x);
		}

		for (int i = 0; i < q; ++i) {
			pt p = EV[i] + v[_i] * T[i];
			ld cy = p.y - c * p.x;
			ev.push_back(make_pair(cy, i + n));
			xs.push_back(p.x);
			xs.push_back(p.x - 1);
			xs.push_back((EV[i] + v[_j] * T[i]).x);
			xs.push_back((EV[i] + v[_j] * T[i]).x - 1);
		}
		sort(ev.begin(), ev.end(), [](const pair<ld, int> & a, const pair<ld, int> & b) {
			return a.first < b.first;
		});
		sort(xs.begin(), xs.end());
		xs.resize(unique(xs.begin(), xs.end()) - xs.begin());

		for (int i = 0; i < ev.size(); ++i) {
			if (ev[i].second < n) {
				int j = ev[i].second;
				inc(lower_bound(xs.begin(), xs.end(), P[j].x) - xs.begin(), CNT[j]);
			}
			else {
				int j = ev[i].second - n;
				pt p1 = EV[j] + v[_i] * T[j];
				pt p2 = EV[j] + v[_j] * T[j];
				if (p1.x > p2.x)
					swap(p1.x, p2.x);
				li l = p1.x, r = p2.x;
				if (sig[_i] == -1 && sig[_i] == sig[_j])
					r--;
				if (sig[_i] == 1 && sig[_i] == sig[(_i - 1 + 2 * k) % (2 * k)])
					r--;
				ans[j] += sig[_i] * get(lower_bound(xs.begin(), xs.end(), l) - xs.begin(), lower_bound(xs.begin(), xs.end(), r) - xs.begin());
			}
		}
	}

	for (int i = 0; i < q; ++i)
		printf("%I64d\n", ans[i]);
}

int main() {

	srand(time(NULL));

	read();
	solve();

	return 0;
}