#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
long long a[maxn], b[maxn], k, now;
long long n, l = 1 << 30, r, mid, ans, R, alr;
inline bool calc() {
  memcpy(b, a, sizeof(a)), now = 0, alr = 0;
  for (int i = 0; i <= R; i++) now += b[i + 1];
  for (int i = 1; i <= n; i++, now += b[i + R]) {
    if (now < mid) {
      alr += mid - now;
      b[i + R] += mid - now;
      now = mid;
      if (alr > k) return 0;
    }
    if (i > R) now -= b[i - R];
  }
  return 1;
}
int main() {
  scanf("%I64d%I64d%I64d", &n, &R, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", a + i);
    l = min(l, a[i]);
  }
  r = 2ll * 1e18;
  while (l <= r) {
    mid = l + r >> 1;
    if (calc())
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%I64d\n", ans);
  return 0;
}
