// Author: Pawan Raj
// Problem: D - Shipping Center
// Contest: AtCoder - Panasonic Programming Contest (AtCoder Beginner Contest 195)
// URL: https://atcoder.jp/contests/abc195/tasks/abc195_d

#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define int long long
#define F(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end()
#define show(A) for (auto i: A) cout << i << " "; cout << '\n';
#define show_(A, n) F(i, n) { show(A[i]) }

using namespace std;
using ld = long double;
using vi = vector < int > ;
using mi = map < int, int > ;
using pi = pair < int, int > ;

const int N = 100005;
const int MOD = 1e9 + 7;
const int inf = 1e18 + 1;
/***************************code begins here*****************************/

void solve() {
	int n, m, q;
	cin >> n >> m >> q;
	pi a[n];
	int b[m];
	F(i,n) cin >> a[i].fi >> a[i].se;
	F(i,m) cin >> b[i];
	while(q--){
		int ans = 0;
		vi aa;
		vi vis(n,0);
		int l,r; cin >> l >> r;
		for(int i=0;i<m;i++){
			if(i >= (l-1) && i<r) continue;
			aa.pb(b[i]);
		}
		sort(all(aa));
		// show(aa);
		for(int x : aa){
			int c = -1;
			F(i,n){
				if(vis[i]) continue;
				if(a[i].fi <= x){
					if(c==-1) c = i;
					if(a[c].se < a[i].se) c = i;
				}
			}
			// cout << c << '\n';
			if(c == -1) continue;
			ans += a[c].se;
			vis[c] = 1;
		}
		cout << ans << '\n';
	}
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    // cin >> t;
    while (t--) solve();

    return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define fore(i_in,a) for (auto& i_in: a)
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fio() cin.tie(nullptr);ios::sync_with_stdio(false);
#define DEBUG_CTN(v) cerr<<#v<<":";for(auto itr=v.begin();itr!=v.end();itr++) cerr<<" "<<*itr; cerr<<endl
template<class T> bool chmax(T &a, const T &b) {if (a<b) { a = b; return true; } return 0;}
template<class T> bool chmin(T &a, const T &b) {if (a>b) { a = b; return true; } return 0;}
template<class T> void print(const T &t) { cout << t << "\n"; }
const ll INF = 1LL << 62;
const int iINF = 1 << 30;

int h,w,a,b;
int used[16][16];

int dfs(int x, int y, int n){
    if(y==h) return n==0;
    if(x==w) return dfs(0,y+1,n);
    if(used[y][x]) return dfs(x+1,y,n);
    int res = 0;
    if(y+1<h and !used[y+1][x] and 0<n){
        used[y][x] = used[y+1][x] = 1;
        res += dfs(x+1,y,n-1);
        used[y][x] = used[y+1][x] = 0;
    }
    if(x+1<w and !used[y][x+1] and 0<n){
        used[y][x] = used[y][x+1] = 1;
        res += dfs(x+1,y,n-1);
        used[y][x] = used[y][x+1] = 0;
    }
    res += dfs(x+1,y,n);
    return res;
}

int main() {
    fio(); cin>>h>>w>>a>>b;
    int ans = dfs(0,0,a);
    print(ans);
}
