#include <bits/stdc++.h>
using namespace std;
long long a[500100];
long long b[500100];
long long N, R, K;
bool judge(long long ans) {
  memset((b), 0, sizeof((b)));
  long long Ra = 0;
  long long k = K;
  for (int i = 0; i <= R; ++i) {
    Ra += a[i];
  }
  for (int i = 0; i < N; ++i) {
    if (Ra < ans) {
      k -= (ans - Ra);
      if (k < 0) return false;
      b[min(N - 1, (long long)(i + R))] += (ans - Ra);
      Ra = ans;
    }
    if (i >= R) Ra -= (a[i - R] + b[i - R]);
    if (i + R + 1 < N) Ra += a[i + R + 1];
  }
  return true;
}
int main() {
  while (cin >> N >> R >> K) {
    for (int i = 0; i < N; ++i) {
      cin >> a[i];
    }
    long long l = 0, r = 0x3f3f3f3f3f3f3f3f;
    while (l <= r) {
      long long mid = (l + r) >> 1;
      if (judge(mid)) {
        l = mid + 1;
      } else
        r = mid - 1;
    }
    if (l == 0)
      cout << 0 << endl;
    else
      cout << l - 1 << endl;
  }
  return 0;
}
