#include <bits/stdc++.h>
using namespace std;
long long getint() {
  char ch = getchar();
  long long f = 1, x = 0;
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
const int N = 500500;
int n, r;
long long k;
long long a[N], b[N];
long long le, ri, ans;
void init() {
  n = getint(), r = getint();
  k = getint();
  ri += k;
  for (int i = 1; i <= n; i++) {
    a[i] = getint();
    ri += a[i];
  }
}
bool chk(long long thr) {
  memcpy(b, a, sizeof(a));
  long long sum = 0;
  long long tot = k;
  for (int i = 1; i <= r; i++) {
    sum += b[i];
  }
  for (int i = 1; i <= n; i++) {
    if (i - r - 1 >= 1) sum -= b[i - r - 1];
    if (i + r <= n) sum += b[i + r];
    if (sum < thr) {
      tot -= thr - sum;
      b[min(n, i + r)] += thr - sum;
      sum += thr - sum;
      if (tot < 0) break;
    }
  }
  return tot >= 0;
}
int main() {
  init();
  while (le <= ri) {
    long long mid = (le + ri) >> 1;
    if (chk(mid)) {
      ans = mid;
      le = mid + 1;
    } else {
      ri = mid - 1;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
