#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i= 0;i<(n);++i)
#define sz(s) (int)(s.size())
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using vi = vector<int> ;
using vll = vector<ll>;
using vvi = vector<vi> ;
using vvll = vector<vll>;
using vs = vector<string>;
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define SORT(v) sort((v).begin(),(v).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
const int INF = INT_MAX;
const ll LLINF = LLONG_MAX;

int main() {
    int n,m,q;
    cin >> n >> m >> q;
    vector<P> nim;
    rep(i,n){
        ll w,v;
        cin >> w >> v;
        nim.pb({v,w});
    }
    RSORT(nim);
    vector<ll> box;
    rep(i,m){
        ll x;
        cin >> x;
        box.pb(x);
    }
    vector<int> left,right;
    rep(i,q){
        int l,r;
        cin >> l >> r;
        l--;r--;
        left.pb(l);
        right.pb(r);
    }
    rep(i,q){
        vector<ll> box2;
        ll ans = 0;
        for(int j = 0;j<left[i];j++){
            box2.pb(box[j]);
        }
        for(int j = right[i] + 1; j < m;j++){
            box2.push_back(box[j]);
        }
        SORT(box2);
        rep(j,n){
            ll val = nim[j].first;
            ll wei = nim[j].second;
            rep(k,box2.size()){
                if (wei <= box2[k]){
                    ans+=val;
                    box2[k] = 0;
                    break;
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int N = 59;

int w[N];
int v[N];
int x[N];

int main() {
#ifndef LOCAL
  cin.tie(0);
#endif
  ios::sync_with_stdio(false);
  int n, m, qq;
  cin >> n >> m >> qq;
  for (int i = 0; i < n; ++i) {
    cin >> w[i] >> v[i];
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (v[j] > v[i]) {
        swap(w[i], w[j]);
        swap(v[i], v[j]);
      }
    }
  }
  for (int i = 0; i < m; ++i) {
    cin >> x[i];
  }
  while (qq--) {
    int l, r;
    cin >> l >> r;
    --l;
    --r;
    vector<int> a;
    for (int i = 0; i < l; ++i) {
      a.push_back(x[i]);
    }
    for (int i = r + 1; i < m; ++i) {
      a.push_back(x[i]);
    }
    sort(a.begin(), a.end());
    vector<bool> used(a.size(), false);
    int ans = 0;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < (int)a.size(); ++j) {
        if (!used[j] && a[j] >= w[i]) {
          used[j] = true;
          ans += v[i];
          break;
        }
      }
    }
    cout << ans << '\n';
  }
}
