#include <bits/stdc++.h>
using namespace std;
int a[500000 + 5];
long long ch[500000 + 5];
int n, r;
long long k1;
bool check(long long x, long long k) {
  long long s = 0;
  memset(ch, 0, sizeof(ch));
  for (int i = 1; i <= n; i++) {
    ch[max(i - r, 1)] += a[i];
    if (i + r + 1 <= n) ch[i + r + 1] -= a[i];
  }
  for (int i = 1; i <= n; i++) {
    s += ch[i];
    if (s < x) {
      long long d = x - s;
      if (d > k) return false;
      k -= d;
      s += d;
      if (i + 2 * r + 1 <= n) ch[i + 2 * r + 1] -= d;
    }
  }
  return true;
}
int main() {
  cin >> n >> r >> k1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long l = 0, r1 = 2e18;
  while (l < r1) {
    long long mid = (l + r1 + 1) / 2;
    if (check(mid, k1))
      l = mid;
    else
      r1 = mid - 1;
  }
  cout << l << endl;
}
