#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &a) {
  T ret(0), f(1);
  char ch(getchar());
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    ret = (ret << 2) + ret, ret += ret + (ch ^ 48);
    ch = getchar();
  }
  a = ret * f;
}
inline int Max(int x, int y) { return x > y ? x : y; }
inline int Min(int x, int y) { return x < y ? x : y; }
int n, R, b[500005];
long long k, a[500005 << 1 | 1], ts[500005 * 3];
inline int check(long long x) {
  long long t, ret(0), val(0);
  memset(ts, 0, sizeof(ts));
  for (int i(1); i <= n && ret <= k; i++) {
    val += a[i] + ts[i];
    if (val < x) {
      ret += (t = x - val);
      val += t, ts[i + (R << 1) + 1] -= t;
    }
  }
  return ret <= k;
}
int main() {
  long long l, r, mid, ans;
  read(n), read(R);
  read(k);
  for (int i(1); i <= n; i++) read(b[i]);
  for (int i(1); i <= n; i++) {
    if (i > R)
      a[i - R] += b[i];
    else
      a[1] += b[i];
    a[i + R + 1] -= b[i];
  }
  l = 0, r = (1ll << 60);
  while (l <= r) {
    mid = l + r >> 1ll;
    if (check(mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%lld\n", ans);
  return 0;
}
