#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
const long double pai = acos(-1);
long long n, sz, k;
long long a[500009], crnt[500009];
long long check(long long x) {
  memset(crnt, 0, sizeof(crnt));
  long long need = 0;
  for (int i = 0; i < n; i++) {
    if (i) crnt[i] += crnt[i - 1];
    if (a[i] + crnt[i] >= x) continue;
    long long X = x - (a[i] + crnt[i]);
    crnt[i + 1] += X;
    crnt[min(i + 2 * sz, n - 1) + 1] -= X;
    need += X;
    if (need > k) return 0;
  }
  return 1;
}
int main() {
  cin >> n >> sz >> k;
  for (int i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    long long l = max(0ll, i - sz), r = min(n - 1ll, i + sz);
    a[l] += x, a[r + 1] -= x;
  }
  for (long long i = 1; i < n; i++) a[i] += a[i - 1];
  long long l = 0, r = 2e18;
  while (r - l > 1) {
    if (check((l + r) / 2))
      l = (l + r) / 2;
    else
      r = (l + r) / 2;
  }
  cout << l << endl;
}
