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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define int                     long long int
#define ld                      long double
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define vi                      vector<int>
#define vld                     vector<ld>
#define pii                     pair<int,int>
#define mii                     map<int,int>
#define fi                      first
#define se                      second
#define fastIO                  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> pbds; 
		//order_of_key (k) : Number of items strictly smaller than k .
		//find_by_order(k) : K-th element in a set (counting from zero) (returns an iterator)           


void inp_out()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("debug.txt", "w", stderr);
	#endif
}

int32_t main()
{
	fastIO
	inp_out();
	
	int n, m; 
	cin >> n >> m; 
	
	map < pii, int > mp; 
	mp[{1, n + 1}] = 1; 
	vector < pii > a(m); 
	for(int i = 0; i < m; ++ i)
		cin >> a[i].fi >> a[i].se; 

	mii last; 
	last[n + 1] = 1;  

	sort(a.begin(), a.end()); 

	for(int i = 0; i < m;)
	{
		int val = a[i].fi, j = i; 
		while(a[j].fi == val)
		{
			mp[{a[j].fi + 1, a[j].se + 1}] = mp[{last[a[j].se], a[j].se}] | mp[{last[a[j].se + 2], a[j].se + 2}];
			++ j;  
		}

		for(int k = i; k < j; ++ k)
			last[a[k].se + 1] = a[k].fi + 1; 
		
		i = j; 
	}

	int ans = 0; 
	for(auto i : last)
		ans += mp[{i.se, i.fi}]; 
	cout << ans; 
	
	return 0;
}
#include<bits/stdc++.h>
#define INF 1e9
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
int main(){
	int n,m,q;
	scanf("%d %d %d",&n,&m,&q);
	vector<bool> caja,prod;
	vector<pi> a(n),b(m);
	for(int i = 0; i < n; i++)
		scanf("%d %d",&a[i].second,&a[i].first);
	sort(a.begin(), a.end());
	for(int i = 0; i < m; i++){
		scanf("%d",&b[i].first);
		b[i].second = i;
	}
	sort(b.begin(), b.end());
	while(q--){
		int l,r;
		scanf("%d %d",&l,&r);
		caja.assign(m,true);
		prod.assign(n,true);
		l--;r--;
		for(l; l <= r; l++)
			caja[l]=0;
		ll ans = 0;
		for(int i = 0; i < m; i++){
			if(caja[b[i].second]){
				for(int j = n-1; j >= 0; j--){
					if(prod[j] && a[j].second <= b[i].first){
						ans += a[j].first;
						prod[j] = 0;
						caja[b[i].second]=0;
						break;
					}
				}
			}
		}
		printf("%lld\n", ans);
	}
	return 0;
}