#include <bits/stdc++.h>
using namespace std;
long long n, r, k;
long long a[500005];
long long add[500005];
bool C(long long m) {
  memset(add, 0, sizeof(add));
  long long cnt = 0;
  long long left = k;
  for (int i = 1; i <= r; i++) cnt += a[i];
  for (int i = 1; i <= n; i++) {
    if (i + r <= n) cnt = cnt + a[i + r] + add[i + r];
    if (i - r - 1 >= 1) cnt = cnt - a[i - r - 1] - add[i - r - 1];
    if (m > cnt) {
      if (left < (m - cnt)) return 0;
      add[min(i + r, n)] += (m - cnt);
      left -= (m - cnt);
      cnt = m;
    }
  }
  return 1;
}
int main() {
  scanf("%lld%lld%lld", &n, &r, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long lb = 0, ub = 2000000000000000000;
  while (lb + 1 < ub) {
    long long m = (lb + ub) / 2;
    if (C(m))
      lb = m;
    else
      ub = m;
  }
  printf("%lld", lb);
  return 0;
}
