#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, r, k;
  scanf("%lld %lld %lld", &n, &r, &k);
  long long a[500005];
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  long long Max = 2e18, Min = 0;
  while (Max > Min + 1) {
    long long temp[500005];
    for (int i = 0; i < n; i++) temp[i] = a[i];
    long long mid = (Max + Min) / 2;
    int L = 0, R = -1;
    long long tot = 0;
    long long less = k;
    for (int i = 0; i < n; i++) {
      while (R < i + r && R < n - 1) R++, tot += temp[R];
      while (L < i - r) tot -= temp[L], L++;
      if (tot < mid) {
        temp[R] += mid - tot;
        less -= mid - tot;
        tot = mid;
      }
      if (less < 0) break;
    }
    if (less < 0)
      Max = mid;
    else
      Min = mid;
  }
  printf("%lld\n", Min);
}
