#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
 
template<class T> inline bool chmax(T &a, T b){
    if(a<b){
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmin(T &a, T b){
    if(a>b){
        a = b;
        return true;
    }
    return false;
}
int w[51],v[51];
int x[51];
int main(){
    int n,m,q;
    cin >> n >> m >> q;
    rep(i,n)cin >> w[i] >> v[i];
    rep(i,m)cin >> x[i];

    rep(zz,q){
        int L,R;
        cin >> L >> R;
        vector<pair<int,int> > p;
        for(int i=0;i<L-1;i++){
            p.push_back(MP(x[i],inf));
        }
        for(int i=R;i<m;i++){
            p.push_back(MP(x[i],inf));
        }

        for(int i=0;i<n;i++){
            p.push_back(MP(w[i],v[i]));
        }
        sort(p.begin(),p.end());
        int res = 0;
        priority_queue<int> pq;
        for(auto x:p){
            if(x.second==inf){
                if(!pq.empty()){
                    res += pq.top();
                    pq.pop();
                }
            }else{
                pq.push(x.second);
            }
        }
        cout << res << "\n";
    }
    return 0;
}
#include <algorithm>
#include <functional>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using ll = long long;
using namespace std;

ll dp[51][51] = {0};

int main(int argc, char *argv[]) {
  ll N, M, Q;
  cin >> N >> M >> Q;
  vector<pair<ll, ll>> wv_org(N);
  vector<pair<ll, ll>> wv(N);
  for (int i = 0; i < N; i++) {
    cin >> wv_org[i].first >> wv_org[i].second;
  }
  vector<pair<ll, int>> box(M, pair<ll, int>(0, 0));
  for (int i = 0; i < M; i++) {
    cin >> box[i].first;
    // 元のindex 覚えておく
    box[i].second = i;
  }
  sort(box.begin(), box.end());
  vector<ll> ans(Q, 0);
  for (int i = 0; i < Q; i++) {
    wv = wv_org;
    ll l, r;
    cin >> l >> r;
    l--, r--;
    for (int j = 0; j < M; j++) {
      if (box[j].second >= l && box[j].second <= r) {
        continue;
      }
      ll v = 0;
      ll used = -1;
      for (int k = 0; k < N; k++) {
        if (box[j].first >= wv[k].first && v < wv[k].second) {
          v = wv[k].second;
          used = k;
        }
      }
      if (used != -1) {
        wv[used].first = 1LL << 60;
        ans[i] += v;
      }
    }
  }
  for (int i = 0; i < Q; i++) {
    cout << ans[i] << endl;
  }
}
