#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 5e5 + 10;
LL a[N], c[N];
bool check(int n, int r, LL k, LL m) {
  memset(c, 0, sizeof c);
  for (int i = 1; i <= n; i++) {
    int lx = max(i - r, 1), rx = min(n + 1, i + r + 1);
    c[lx] += a[i];
    c[rx] -= a[i];
  }
  for (int i = 1; i <= n; i++) {
    c[i] += c[i - 1];
    if (c[i] < m) {
      LL need = m - c[i];
      if (need > k) {
        return false;
      }
      k -= need;
      c[i] += need;
      if (i + 2 * r + 1 <= n) {
        c[i + 2 * r + 1] -= need;
      }
    }
  }
  return true;
}
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  LL n, r, k;
  cin >> n >> r >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  LL L = 0, R = 2e18;
  while (L < R) {
    LL mid = (L + R + 1) / 2;
    if (check(n, r, k, mid))
      L = mid;
    else
      R = mid - 1;
  }
  cout << L << endl;
}
