#include <bits/stdc++.h>
using namespace std;
static char buf[100000], *p1 = buf, *p2 = buf;
static const int MAXN = 1e6 + 10;
static const int OO = 0x3fffffff;
long long read() {
  long long ret = 0;
  char ch =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
           ? EOF
           : *p1++);
  while (ch < '0' || ch > '9')
    ch = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
              ? EOF
              : *p1++);
  while (ch >= '0' && ch <= '9')
    ret = ret * 10 + ch - '0',
    ch = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
              ? EOF
              : *p1++);
  return ret;
}
long long n, R, k, rr, mid;
long long data[MAXN];
long long tp[MAXN], now, need;
long long l = 1 << 30, ans;
bool check() {
  memcpy(tp, data, sizeof(data));
  now = need = 0;
  for (int i = 0; i <= R; ++i) now += tp[i + 1];
  for (int i = 1; i <= n; ++i, now += tp[i + R]) {
    if (now < mid) {
      need += mid - now;
      tp[i + R] += mid - now;
      now = mid;
      if (need > k) return 0;
    }
    if (i > R) now -= tp[i - R];
  }
  return 1;
}
int main() {
  scanf("%lld%lld%lld", &n, &R, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &data[i]);
    l = min(l, data[i]);
  }
  rr = 2ll * 1e18;
  while (l <= rr) {
    mid = l + rr >> 1;
    if (check()) {
      ans = mid;
      l = mid + 1;
    } else {
      rr = mid - 1;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
