#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
#define pb push_back
#define mp make_pair
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
const int MAX_N = 103;

int N,M,Q;
int W[MAX_N],V[MAX_N];
int X[MAX_N];
int L[MAX_N],R[MAX_N];

void solve()
{
	vector<pair<int,int>> v;
	for(int i=1;i<=N;++i)v.emplace_back(V[i],W[i]);
	sort(v.rbegin(),v.rend());
	for(int i=0;i<Q;++i){
		const int l=L[i],r=R[i];
		multiset<int> cap;
		for(int k=1;k<l;++k)cap.insert(X[k]);
		for(int k=r+1;k<=M;++k)cap.insert(X[k]);
		ll ans = 0;
		for(auto& p : v){
			auto it = cap.lower_bound(p.second);
			if(it!=cap.end()){
				ans += p.first;
				cap.erase(it);
			}
		}
		cout<<ans<<'\n';
	}
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	cin >> N >> M >> Q;
	for(int i=1;i<=N;++i)cin>>W[i]>>V[i];
	for(int i=1;i<=M;++i)cin>>X[i];
	for(int i=0;i<Q;++i)cin>>L[i]>>R[i];
	solve();
	return 0;
}
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<set>
using namespace std;
inline int read(){
	int x = 0, f = 1; char c = getchar();
	while(c < '0' || c > '9'){if(c == '-')f = -1; c = getchar();}
	while(c >= '0' && c <= '9'){x = (x << 3) + (x << 1) + c - '0'; c = getchar();}
	return x * f;
}
set<int> c;
int n;
int main(){
    for(int i = 6; i <= 10000; i += 6){
    	c.insert(i);
	}
    for(int i = 10; i <= 10000; i += 10){
    	c.insert(i);
	}
        
    for(int i = 14; i <= 10000; i += 14){
    	c.insert(i);
	}
    n = read();
    --n;
    printf("%d ", 3 * 5 * 7);
    for(int i : c){
        printf("%d ", i);
        --n;
        if(!n){
        	break;
		}
    }
    return 0;
}