#include <bits/stdc++.h>
#pragma GCC target("arch=skylake-avx512")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = 1; i < (int)(n+1); ++i)
const long long INF = 1LL<<60;
const long long MOD = 1000000007;
const long long mod = 998244353;
int ri() {
	int n;
	scanf("%d", &n);
	return n;
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main() {
  	int N,M,Q;
    cin>>N>>M>>Q;
    vector<pair<int,int>>W(N);
    vector<int>X(M);
    rep(i,N){
        cin>>W[i].second;
        cin>>W[i].first;
    }
    rep(i,M){
        cin>>X[i];
    }
    int ans=0;
    sort(W.rbegin(),W.rend());
    rep(i,Q){
        int L,R;
        cin>>L>>R;
        int score=0;
        int cn=M-(R-L+1);
      	if(cn!=0){
        vector<int>box(cn);
        vector<bool>H(cn,false);
        cn=0;
        rep(j,M){
            if(L-1<=j&&j<=R-1){}
            else{
                box[cn]=X[j];
                cn++;
            }
        }
        sort(box.begin(),box.end());
        rep(j,N){
            rep(k,cn){
                if(H[k]==false&&W[j].second<=box[k]){
                    H[k]=true;
                    score+=W[j].first;
                    k=cn;
                }
            }
        }
        }
        cout<<score<<endl;
    }
}



/*
                                                  
  _|_|                              _|  _|    _|  
_|    _|  _|  _|_|  _|_|_|_|        _|  _|  _|    
_|    _|  _|_|          _|          _|  _|_|      
_|    _|  _|          _|      _|    _|  _|  _|    
  _|_|    _|        _|_|_|_|    _|_|    _|    _|  
                                                                                                    
*/ 
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
//#define ls (rt<<1)
//#define rs (rt<<1|1)
#define vi vector<int>
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;i++)
#define fi first
#define se second
typedef long long ll;
using namespace std;
const int maxn=1<<19;
int dp[maxn];//max use side
bool ck[maxn];
int g[20][20];
int cnt[maxn];
int main(){
	ios::sync_with_stdio(0);
	int n,m;cin>>n>>m;
	rep(i,1,m){
		int a,b;cin>>a>>b;
		g[a][b]=g[b][a]=1;
	}
	rep(i,1,n)g[i][i]=1;
	memset(dp,0x3f,sizeof(dp));
	rep(mask,0,1<<n){
		vi po;
		rep(j,1,n){
			if(mask&(1<<(j-1)))po.pb(j);
		}
		ck[mask]=1;
		for(int i=0;i<po.size();i++)
		for(int j=i;j<po.size();j++)
		if(!g[po[i]][po[j]]){ck[mask]=0;break;}	
		if(ck[mask]){
			dp[mask]=1;
		}
	}
	rep(i,1,n)dp[1<<(i-1)]=1;
	rep(mask,0,1<<n){
		int left=(1<<(n))-1;
		left^=mask;int bl=left;
		for(int i=bl;i;i=(i-1)&bl){
			if(ck[i])dp[i|mask]=min(dp[i|mask],dp[mask]+1);
		}
	}
	cout<<dp[(1<<(n))-1];
	return 0;
}