#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
;
long long n, r, a[N], b[N];
long long k;
bool binarySearchCheck(long long);
int main() {
  cin >> n >> r >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long l = 0, r = 2e18;
  while (r - l > 1) {
    long long med = (l + r) / 2;
    if (binarySearchCheck(med))
      l = med;
    else
      r = med;
  }
  cout << l << endl;
}
bool binarySearchCheck(long long atLeast) {
  long long kp = k;
  memset(b, 0, sizeof b);
  copy(a, a + n, b);
  long long psum = 0;
  for (int i = 0; i <= r; i++) psum += b[i];
  if (false) cout << "@: " << atLeast << endl;
  for (int i = 0; i < n; i++) {
    if (false) cout << "--: " << i << ' ' << psum << ' ' << kp << endl;
    if (psum < atLeast) {
      if (kp < atLeast - psum) return false;
      b[i + r] += atLeast - psum;
      kp -= atLeast - psum;
      psum = atLeast;
    }
    psum += b[i + r + 1];
    if (i >= r) psum -= b[i - r];
  }
  if (false) cout << "! Passed" << endl;
  return true;
}
