#include <cstdio>
#include <vector>
#include <algorithm>

#define MOD (1000000007)
#define EPS (1e-9)
#define INF (2117117117)
#define LLINF (2117117117117117117LL)
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define sqr(a) ((a) * (a))
#define sz(a) ((int) (a).size())

typedef unsigned int uint;
typedef long long llong;
typedef long double ldouble;
typedef unsigned long long ullong;

using namespace std;

const int MAXN = 100117;

int t, n, m, q, h[MAXN], ans, p, a;
vector<vector<bool> > l;

int main()
{
    scanf("%d %d %d", &t, &n, &m);
    for (int i = 0; i < n; scanf("%d", &h[i++]));
    l.resize(m, vector<bool>(n));

    for (int j = 0, cur = 0; j < n; j++)
    {
        if (cur < h[j])
            cur = h[j];
        for (int i = cur; i < m; i++)
            l[i][j] = true, ans++;
    }
    printf("%d ", ans);
    scanf("%d", &q);
    while (q--)
    {
        scanf("%d %d", &p, &a);
        p--;
        for (; h[p] < a; h[p]++)
            for (int j = p + 1; j < n && l[h[p]][j]; l[h[p]][j] = false, ans--, j++);
        for (; h[p] > a; h[p]--)
            if (p == 0 || l[h[p] - 1][p - 1])
            {
                l[h[p] - 1][p] = true;
                ans++;
                for (int j = p + 1; j < n && h[j] <= h[p] - 1; l[h[p] - 1][j] = true, ans++, j++);
            }
        printf("%d ", ans);
    }
    putchar('\n');

    return 0;
}
