#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 5;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, m, len;
long long a[maxn];
long long b[maxn];
void add(long long l, long long r, long long val) {
  b[l] += val;
  b[r + 1] -= val;
}
bool check(long long val) {
  for (long long i = 1; i <= n; i++) b[i] = a[i];
  long long res = 0;
  for (long long i = 1; i <= n; i++) {
    b[i] += b[i - 1];
    if (b[i] < val) {
      res = res + (val - b[i]);
      add(i, i + len * 2, val - b[i]);
    }
    if (res > m) return false;
  }
  return true;
}
signed main() {
  n = read(), len = read(), m = read();
  for (long long i = 1; i <= n; i++) {
    long long x = read();
    a[i] += x, a[i + len + 1] -= x;
    long long p = i - len;
    if (p <= 0) p = 1;
    a[p] += x, a[i] -= x;
  }
  long long l = 0, r = 2e18;
  while (l < r) {
    long long mid = (l + r + 1) >> 1;
    if (check(mid))
      l = mid;
    else
      r = mid - 1;
  }
  printf("%lld\n", l);
  return 0;
}
