#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <utility>
#include <set>
#include <numeric>
#include <queue>
#include <sstream>
#include <map>
#include <unordered_map>
#include <cmath>

// #include <boost/numeric/ublas/vector.hpp>
// #include <boost/numeric/ublas/matrix.hpp>
// #include <boost/numeric/ublas/io.hpp>

// namespace ublas = boost::numeric::ublas;
using namespace std;
using LLI = long long int;

#define Rep(i, N) for (int i = 0; i < N; i++)

// const LLI MAX = 100000001;

using VALUE = int;
using SIZE = int;

int valueOf(vector<SIZE> hako, vector<pair<VALUE, SIZE>> nimotsu) {
    std::sort(hako.begin(), hako.end());


    // int j = 0;
    // for (auto h : hako) {
    //     while (j < int(nimotsu.size())) {
    //         auto a = nimotsu[j++];
    //         if (h >= a.second) {
    //             val += a.first;
    //             break;
    //         }
    //     }
    // }

    int val = 0;
    vector<int> X(hako.size(), 0);
    for (auto p : nimotsu) {
        bool f = false;
        for (int j = 0; j < hako.size(); j++) {
            if (X[j] == 0 && hako[j] >= p.second) {
                X[j] = p.first;
                val += p.first;
                f = true;
                break;
            }
        }
    }

    return val;
}
 
int main(int argc, char *argv[])
{
    
    int N, M, Q;
    cin >> N >> M >> Q;

    vector<pair<VALUE, SIZE>> nimotsu;
    Rep(i, N) {
        int w, v;
        cin >> w >> v;
        nimotsu.emplace_back(v, w);
    }

    vector<SIZE> hako(M);
    Rep(i, M) {
        cin >> hako[i];
    }

    vector<pair<int, int>> query;
    Rep(i, Q) {
        int s, e;
        cin >> s >> e;
        query.emplace_back(s-1, e-1);
    }

    sort(nimotsu.begin(), nimotsu.end(), greater<pair<VALUE, SIZE>>());
    
    for (pair<int, int> q : query) {
        vector<SIZE> temp;
        for (int i = 0; i < q.first; i++) {
            temp.push_back(hako[i]);
        }
        for (int i = q.second + 1; i < hako.size(); i++) {
            temp.push_back(hako[i]);
        }

        int val = valueOf(temp, nimotsu);

        cout << val << endl;
    }


    return 0;
}
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include <iomanip>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int digit(int n){
   if(n < 10)  return n;
   return digit(n/10) + n%10;
}
int main(){
  int A,B;
  cin>>A>>B;
  cout<<A/B;
return 0;}
