#include <cstdio>
#define MAXN 400010
long long num[MAXN];
long long max(long long a, long long b) {return a > b ? a : b;}
long long tree[MAXN * 4];
void build(int node, int l, int r) {
if (l == r) {
tree[node] = num[l];
return;
}
int mid = (l + r) >> 1;
build(node * 2, l, mid);
build(node * 2 + 1, mid + 1, r);
tree[node] = max(tree[node * 2], tree[node * 2 + 1]);
}
int x, y;
void change(int node, int l, int r, int pos, int k) {
if (l == r) {
tree[node] = k * 1ll;
return;
}
int mid = (l + r) >> 1;
if (pos <= mid) change(node * 2, l, mid, pos, k);
else change(node * 2 + 1, mid + 1, r, pos, k);
tree[node] = max(tree[node * 2], tree[node * 2 + 1]);
}
int main() {
int n, m, q; scanf("%d %d %d", &n, &m, &q);
x = 1, y = n;
long long sum = 0, mx = 0;
for (int i = 1; i <= n; i++) {
scanf("%lld", &num[i]);
mx = max(mx, num[i]);
sum += num[i];
}
build(1, 1, n);
while (q--) {
printf("%lld\n", max(tree[1], sum / m + (sum % m == 0 ? 0 : 1)));
int x; long long a; scanf("%d %lld", &x, &a);
sum -= num[x]; num[x] = a;
sum += a;
change(1, 1, n, x, a);
}
printf("%lld\n", max(tree[1], sum / m + (sum % m == 0 ? 0 : 1)));
return 0;
}