#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
  cin.exceptions(ios::failbit);
}
static bool protect(vector<long long> a, int R, long long def, long long K) {
  int N = ((long long)(a).size());
  long long cur = 0;
  for (int i = 0; i <= min(N - 1, R); i++) cur += a[i];
  for (int i = 0; i < N; i++) {
    if (cur < def) {
      long long extra = def - cur;
      if (extra > K) return false;
      K -= extra;
      int pos = min(N - 1, i + R);
      a[pos] += extra;
      cur += extra;
    }
    if (i >= R) cur -= a[i - R];
    if (i + R + 1 < N) cur += a[i + R + 1];
  }
  return K >= 0;
}
static void solve() {
  int N, R;
  long long K;
  cin >> N >> R >> K;
  vector<long long> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  long long lo = 0;
  long long hi = 2000000000000000000LL;
  while (hi - lo > 1) {
    long long mid = (lo + hi) / 2;
    if (protect(a, R, mid, K))
      lo = mid;
    else
      hi = mid;
  }
  cout << lo << '\n';
}
int main(int argc, const char **argv) {
  redirect(argc, argv);
  solve();
  return 0;
}
