#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
#include <random>
#include <cassert>
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define REPE(i, n) for (int (i)=0; (i) <= (n); (i)++)
#define CONTAINS_MAP(m, a) ((m).find((a)) != m.end())
#define CONTAINS_SET(m, a) ((m).find((a)) != m.end())
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; exit(0); }
void Yes() { cout << "Yes" << endl; exit(0); }
void No() { cout << "No" << endl; exit(0); }

int N, M;
int H[200010];
int W[200010];

int A[200010];
int B[200010];

int get(int ary[200010], int a, int b)
{
	return ary[b] - ary[a];
}

int func(int k, int w)
{
	if (k % 2 == 0)
	{
		int v = get(A, 0, k / 2);
		int h = H[k] - w;
		int w = get(B, k / 2, N / 2);
		return v + h + w;
	}
	else
	{
		int v = get(A, 0, (k - 1) / 2);
		int h = w - H[k - 1];
		int w = get(B, (k - 1) / 2, N / 2);
		return v + h + w;
	}
}


int cur = 0;

//---------- にぶたん[f,f,f,f,'t',t,t,t] ----------
bool isOK(int index)
{
	return cur < H[index];
}

int binary_search(int n)
{
	int left = -1;
	int right = n;
	while (right - left > 1)
	{
		int mid = left + (right - left) / 2;
		if (isOK(mid))
			right = mid;
		else
			left = mid;
	}
	return right;
}


signed main()
{
	cin >> N >> M;
	REP(i, N) cin >> H[i];
	REP(i, M) cin >> W[i];
	H[N] = LLONG_MAX;

	ARY_SORT(H, N);

	A[0] = 0;
	for (int i = 0; i < N / 2; i++)
	{
		int i1 = i * 2;
		int i2 = i * 2 + 1;
		A[i + 1] = A[i] + abs(H[i2] - H[i1]);
	}

	B[0] = 0;
	for (int i = 0; i < N / 2; i++)
	{
		int i1 = i * 2 + 1;
		int i2 = i * 2 + 2;
		B[i + 1] = B[i] + abs(H[i2] - H[i1]);
	}

	int ans = LLONG_MAX;
	REP(i, M)
	{
		cur = W[i];
		int index = binary_search(N);
		int a = func(index, cur);
		ans = min(a, ans);
	}
	cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define endl "\n"
#define mod 1000000007
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)

void solve()
{
    int n, m, q, x, y;
    cin >> n >> m >> q;
    vector<pair<int, int>> items;
    int boxes[m + 1];
    rep(i, n)
    {
        cin >> x >> y;
        items.pb({y, x});
    }
    sort(items.begin(), items.end(),greater<pair<int,int>>());
    rep(i, m)
    {
        cin >> boxes[i];
    }
    multiset<int> s;
    ll ans = 0;
    rep(i, q)
    {
        cin >> x >> y;
        for (int i = 0; i < x - 1; i++)
        {
            s.insert(boxes[i]);
        }
        for (int i = y; i < m; i++)
        {
            s.insert(boxes[i]);
        }
        for (int i = 0; i < n; i++)
        {
            int weight = items[i].second;
            int val = items[i].first;
            auto it = s.lower_bound(weight);
            if (it != s.end())
            {
                ans += val;
                s.erase(s.find(*it));
            }
        }
        cout << ans << endl;
        s.clear();
        ans=0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    solve();

    return 0;
}