#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll,ll>pll;


const int mod = 1e9 + 7;

pair<int,int> find(vector<vector<int>>& grid){
    for(int i = 0; i < grid.size(); i++){
        for(int j = 0; j < grid[0].size(); j++){
            if(grid[i][j] == 0){
                return mp(i, j);
            }
        }
    }
    return mp(-1,-1);
}

void dfs(int& ans, vector<vector<int>>& grid, int a, int b){
    int n = grid.size();
    int m = grid[0].size();
    pair<int,int>start = find(grid);
    if(start.first == -1 && start.second == -1){
        ans++;
        return;
    }
    int i = start.first;
    int j = start.second;
    if(a > 0){
        // use 2x1 
        // I
        // I
        if(i+1 < n && grid[i+1][j] == 0){
            grid[i][j] = 1;
            grid[i+1][j] = 1;
            dfs(ans, grid, a-1, b);
            grid[i][j] = 0;
            grid[i+1][j] = 0; 
        }
        if(j+1 < m && grid[i][j+1] == 0){
            grid[i][j] = 1;
            grid[i][j+1] = 1;
            dfs(ans, grid, a-1, b);
            grid[i][j] = 0;
            grid[i][j+1] = 0; 
        }
    }
    if(b > 0){
        grid[i][j] = 1;
        dfs(ans, grid, a, b-1);
        grid[i][j] = 0;
    }
}

int main(){
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    vector<vector<int>>grid(h, vector<int>(w, 0));
    int ans = 0;
    dfs(ans, grid, a, b);
    cout << ans << endl;
}
#include <sstream>
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <numeric>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <list>
#include <cassert>
#include <cmath>
#include <climits>
#include <map>
#include <queue>
#include <functional>
#include <cassert>
using namespace std;
using ll = int64_t;
#define rep(i, a) for (int i = 0; i < (int)(a); ++i)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define repr(i, a) for (int i = (int)((a) - 1); i >= 0; --i)
template <class T> class V1 : public vector<T> { public: V1(size_t n1, T init = T()) : vector<T>(n1, init) {} };
template <class T> class V2 : public vector<V1<T>> { public: V2(size_t n1, size_t n2, T init = T()) : vector<V1<T>>(n1, V1<T>(n2, init)) {} };
template <class T> class V3 : public vector<V2<T>> { public: V3(size_t n1, size_t n2, size_t n3, T init = T()) : vector<V2<T>>(n1, V2<T>(n2, n3, init)) {} };
template <class T> class V4 : public vector<V3<T>> { public: V4(size_t n1, size_t n2, size_t n3, size_t n4, T init = T()) : vector<V3<T>>(n1, V3<T>(n2, n3, n4, init)) {} };
template <class T> class V5 : public vector<V4<T>> { public: V5(size_t n1, size_t n2, size_t n3, size_t n4, size_t n5, T init = T()) : vector<V4<T>>(n1, V4<T>(n2, n3, n4, n5, init)) {} };
template <class T> vector<T> GetV1(istream& in, size_t N) { vector<T> ret; ret.reserve(N); rep(i, N) { T a; in >> a; ret.emplace_back(a); } return ret; }

ll Calc(vector<pair<int, int>> items, vector<int> xs)
{
	sort(xs.begin(), xs.end());
	sort(items.begin(), items.end());
	ll sum = 0;
	for (int x : xs) {
		int vmax = 0;
		int imax = -1;
		rep(i, items.size()) {
			if (items[i].first > x)
				break;
			if (vmax < items[i].second) {
				vmax = items[i].second;
				imax = i;
			}
		}
		if (imax >= 0) {
			sum += vmax;
			items[imax].second = 0;
		}
	}
	return sum;
}

int main()
{
#if 0
	stringstream sstr;
	sstr << R"()";
	auto& in = sstr;
#else
	auto& in = cin;
#endif

	int N, M, Q;
	in >> N >> M >> Q;
	vector<pair<int, int>> items(N); // w, v
	rep(i, N) {
		in >> items[i].first >> items[i].second;
	}
	vector<int> xs(M);
	rep(i, M) {
		in >> xs[i];
	}

	rep(q, Q) {
		int l, r;
		in >> l >> r;
		ll vsum = 0;
		auto cxs = xs;
		for (int i = l - 1; i <= r - 1; ++i) {
			cxs[i] = 0;
		}
		cout << Calc(items, cxs) << "\n";
	}

	return 0;
}
