#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int MAXN = 5e5 + 10;
long long n, a[MAXN], rr, kk, b[MAXN], c[MAXN];
bool check(long long mid) {
  long long cnt = kk;
  for (int i = 1; i <= n; i++) b[i] = c[i];
  for (int i = 1; i <= n; i++) {
    b[i] += b[i - 1];
    if (b[i] < mid) {
      long long d = mid - b[i];
      if (d > cnt) return false;
      b[i] += d;
      b[min(i + 2 * rr + 1, n + 1)] -= d;
      cnt -= d;
    }
  }
  return true;
}
int main() {
  cin >> n >> rr >> kk;
  for (long long i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    a[max(i - rr, (long long)1)] += x;
    a[min(i + rr + 1, n + 1)] -= x;
  }
  long long Min = 1e18;
  for (int i = 1; i <= n; i++) c[i] = a[i];
  for (int i = 1; i <= n; i++) a[i] += a[i - 1], Min = min(Min, a[i]);
  long long l = Min, r = Min + kk;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
  cout << r << endl;
  return 0;
}
