#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1010000;
long long ps[MAX_N];
long long A[MAX_N];
long long hei[MAX_N];
long long d[MAX_N];
bool C(const long long mid);
long long n, r, k;
int main() {
  scanf("%lld%lld%lld", &n, &r, &k);
  for (long long i = 0; i < n; ++i) {
    scanf("%llu", A + i);
  }
  for (long long i = 1; i <= n; ++i) {
    ps[i] = ps[i - 1] + A[i - 1];
  }
  for (long long i = 0; i < n; ++i) {
    hei[i] = ps[min(n, i + r + 1)] - ps[max(0ll, i - r)];
  }
  long long lb = 0, rb = LLONG_MAX;
  while (lb + 1 < rb) {
    long long mid = (lb + rb) >> 1;
    if (C(mid)) {
      lb = mid;
    } else {
      rb = mid;
    }
  }
  printf("%lld\n", lb);
  return 0;
}
bool C(const long long mid) {
  memset(d, 0, sizeof(d));
  long long tk = k, sd = 0;
  for (long long i = 0; i < n; ++i) {
    sd -= d[i];
    d[i] = 0;
    if (sd + hei[i] < mid) {
      long long m = mid - hei[i] - sd;
      sd += m;
      tk -= m;
      if (tk < 0) {
        return false;
      }
      d[i + r + r + 1] = m;
    }
  }
  return true;
}
