#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, m, q;
    cin >> n >> m >> q;
    vs64 w(n), v(n);
    rep (i, n)
    {
        cin >> w[i] >> v[i];
    }

    vs64 x(m);
    rep (i, m) cin >> x[i];

    rep (i, q)
    {
        int l, r;
        cin >> l >> r;
        --l;
        vs64 y;
        rep (j, m)
        {
            if (IN(l, r, j)) continue;
            y.emplace_back(x[j]);
        }
        sort(y.begin(), y.end());


        s64 ans = 0;
        vector< bool > used(n, false);
        for (const auto& X : y)
        {
            int idx = -1;
            rep (j, n)
            {
                if (used[j]) continue;
                if (w[j] <= X && !used[j])
                {
                    if (idx < 0)
                    {
                        idx = j;
                    }
                    else if (v[idx] < v[j] || (v[idx] == v[j] && w[idx] < w[j]))
                    {
                        idx = j;
                    }
                }
            }
            if (idx >= 0)
            {
                ans += v[idx];
                used[idx] = true;
            }
        }
        cout << ans << "\n";
    }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<ctime>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<cfloat>
#include<functional>
#include<tuple>
#include<math.h>
#include<bitset>
#include<stack>
#include<set>
#include<random>
#include<stdlib.h>
#define rip(i,n) for(int i=0;i<n;i++)
#define Rip(i,n) for(int i=1;i<=n;i++)
#define RIP(i,a,b) for(int i=a;i<b;i++)
#define all(V) V.begin(),V.end()
#define sec  setprecision;
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops");
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
using ll = long long;
using ld = long double;
using Pa = pair<ll,ll>;
const ll MOD = 998244353;
ll gcd(ll a, ll b)
{
	if (a % b == 0)	return(b);
	else return(gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
ll modpow(ll x, ll n, ll mod) {
	x %= mod;
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return (modpow((x * x) % mod, n / 2, mod) % mod);
	else
		return (x * modpow(x, n - 1, mod)) % mod;
}
bool is_prime(int n) {//素数判定
	bool ans = true;
	for (int i = 2; i <= sqrt(n); i++)if (n % i == 0)ans = false;
	return ans;
}
void solveA() {
	int n; cin >> n;
	vector<ll>a(n);
	vector<ll>b(n);
	rip(i, n)cin >> a[i];
	rip(i, n)cin >> b[i];
	vector<Pa>bmax(n);
	vector<ll>amax(n);
	ll bmaxx = 0;
	rip(i, n) {
		bmaxx = max(bmaxx, b[i]);
		bmax[i].first = bmaxx;
		if (bmaxx == b[i]) {
			bmax[i].second = i;
		}
	}
	ll amaxx = 0;
	rip(i, n) {
		amaxx = max(amaxx, a[i]);
		amax[i] = amaxx;
	}
	vector<ll>ans(n);
	ans[0] = a[0] * b[0];
	for (int i = 1; i < n; i++) {
		ll maxx = 0;
		maxx = b[i] * amax[i];
		ans[i] = max(ans[i - 1], maxx);
	}
	rip(i, n)cout << ans[i] << endl;
}
void solveB() {
	int N, K;
	cin >> N >> K;
	vector<ll>a(N);
	rip(i, N)cin >> a[i];
	sort(all(a));
}
void solveC() {

}
int main() {
	solveA();
}