#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int N = 5e5 + 5;
int a[N];
long long sum[N], b[N], c[N];
int main() {
  int n, r;
  long long k;
  scanf("%d%d%I64d", &n, &r, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) sum[i] = a[i] + sum[i - 1];
  for (int i = 1; i <= n; i++)
    b[i] = sum[min(i + r, n)] - sum[max(1, i - r) - 1];
  long long L = 0, R = 4e18;
  while (L <= R) {
    long long mid = L + R >> 1;
    memset(c, 0, sizeof c);
    long long tmp = 0, s = 0;
    for (int i = 1; i <= n; i++) {
      s += c[i];
      long long t = mid - b[i] - s;
      if (t > 0) {
        tmp += t;
        s += t;
        c[min(i + 2 * r, n) + 1] -= t;
      }
      if (tmp > k) break;
    }
    if (tmp > k)
      R = mid - 1;
    else
      L = mid + 1;
  }
  printf("%I64d\n", L - 1);
  return 0;
}
