#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3bbbbbbbbbbbbbbb;
int n, r;
long long k, a[502333], tmp[502333];
inline bool check(long long mid) {
  int i;
  long long now = 0, lft = k, anow;
  memset(tmp, 0, sizeof tmp);
  for (i = 1; i <= n; ++i) {
    now += tmp[i], anow = a[i] + now;
    if (anow < mid) {
      lft -= mid - anow, now += mid - anow,
          tmp[min(i + 2 * r + 1, n + 1)] -= mid - anow;
      if (lft < 0) return 0;
    }
  }
  return 1;
}
int main() {
  cin >> n >> r >> k;
  int i, now;
  for (i = 1; i <= n; ++i) {
    scanf("%d", &now);
    a[max(i - r, 1)] += now, a[min(i + r + 1, n + 1)] -= now;
  }
  for (i = 1; i <= n; ++i) a[i] += a[i - 1];
  long long l = 0, r = inf, mid;
  while (l < r) {
    mid = (l + r) >> 1;
    if (check(mid))
      l = mid + 1;
    else
      r = mid;
  }
  cout << l - 1;
  return 0;
}
