#include <bits/stdc++.h>
using namespace std;
int n, R;
long long k, a[500005], b[500005], aa[500005];
struct st {
  int id;
  long long need;
} s[500005];
int main() {
  scanf("%d%d%I64d", &n, &R, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    int lll = max(1, i - R), rrr = min(n, i + R);
    b[lll] += a[i];
    b[rrr + 1] -= a[i];
  }
  for (int i = 1; i <= n; i++) aa[i] = aa[i - 1] + b[i];
  long long l = 0, r = 4000000000000000000ll;
  while (l + 1 < r) {
    long long mid = (l + r) / 2, sn = 0;
    for (int i = 1; i <= n; i++)
      if (aa[i] < mid) s[++sn] = (st){i, mid - aa[i]};
    if (!sn) {
      l = mid;
      continue;
    }
    int j = 1;
    long long add = 0, del = 0, nee = 0;
    for (int i = 1; i <= sn; i++) {
      while (j + 1 <= sn && s[j + 1].id - s[i].id <= 2 * R) {
        j++;
        s[j].need += del;
      }
      if (s[i].need > del) {
        nee += s[i].need - del;
        del = s[i].need;
      }
    }
    if (nee <= k)
      l = mid;
    else
      r = mid;
  }
  printf("%I64d", l);
}
