#include <bits/stdc++.h>
using namespace std;
int n, r, a[500005];
long long k, s[1000005];
inline long long chk(long long tar) {
  int i;
  long long tot = 0, ret = 0;
  for (i = 1; i <= n; i++) s[i] = a[i];
  for (i = 1; i <= r; i++) tot += s[i];
  for (i = 1; i <= n; i++) {
    if (i + r <= n) tot += s[i + r];
    if (i - r - 1 >= 1) tot -= s[i - r - 1];
    if (tot < tar) {
      ret += (tar - tot);
      s[i + r] += (tar - tot);
      tot = tar;
      if (ret > (1ll << 60ll)) return ret;
    }
  }
  return ret;
}
int main() {
  scanf("%d%d%lld", &n, &r, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  long long l = 0, r = (1ll << 60ll);
  while (l <= r) {
    long long mid = (l + r) >> 1ll;
    if (chk(mid) <= k) {
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  printf("%lld\n", r);
  return 0;
}
