#include <bits/stdc++.h>

using namespace std ;

const int MAX = 1e5 + 10 ;

int a[MAX] , b[MAX] ;
int arr[MAX] ;
int n , m , q ;

vector< pair<int , int> >vp ;

multiset<int>s ;

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n>>m>>q ;
	for(int i = 0 ; i < n ; ++i)
	{
		cin>>a[i]>>b[i] ;
		vp.emplace_back(b[i] , a[i]) ;
	}
	for(int i = 0 ; i < m ; ++i)
		cin>>arr[i] ;
	sort(vp.begin() , vp.end()) ;
	reverse(vp.begin() , vp.end()) ;
	while(q--)
	{
		s.clear() ;
		int l , r ;
		cin>>l>>r ;
		l-- , r-- ;
		for(int i = 0 ; i < m ; ++i)
		{
			if(i >= l && i <= r)
				continue ;
			s.insert(arr[i]) ;
		}
		int ans = 0 ;
		for(auto &p : vp)
		{
			if(!s.size())
				break ;
			auto it = s.lower_bound(p.second) ;
			if(it == s.end())
				continue ;
			ans += p.first , s.erase(it) ;
		}
		cout<<ans<<"\n" ;
	}
	return 0 ;
}		
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define rng(a) a.begin(), a.end()
#define ina(n,a) cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]
#define sz(x) (int)(x).size()
#define se second
#define fi first
#define prev            coyhhhhhhyoc    
#define next          sdNNNmNNNNNNNmds  
#define y0           hNNNNy_yNNNNNN_sNh
#define y1          mNNNNNdtdNNNNNNtsNNm
#define yn          mNNNNNNNNy___smNNNms
#define tm            oooooosyysooooot 
#define read               tyhyt        
#define rank              ytmNmo         
#define index              yyy
#define pb push_back
#define pcnt __builtin_popcountll
#define rrep(i,a,b) for(int i = (b); i >= (a); i--)
#define rall(x,a) for(auto x : a)
#define MOD 1000000007
#define endl "\n"
typedef long long ll;
using namespace std;

const int N = 222222;
vector<int> graph[N];
int a[N], maxi[N];
int n, m;

int solve() {
    cin >> n >> m;
    rep(u, 1, n) {
        cin >> a[u];
    }
    rep(i, 1, m) {
        int u, v;
        cin >> u >> v;
        graph[u].pb(v);
    }
    int ans = -1e9 - 19;
    rrep(u, 1, n) {
        maxi[u] = -1e9 - 19;
        rall(v, graph[u]) {
            int ne = max(maxi[v], a[v]);
            maxi[u] = max(maxi[u], ne);
        }
        ans = max(ans, maxi[u] - a[u]);
    }
    cout << ans << endl;
    return 0;
}
 
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
    while(t--) {
        solve();
    }
    return 0;
}
