#include <bits/stdc++.h>
using namespace std;
const long long inf = 2000000000000000000;
long long r, kol_vo, k;
bool check(long long bin, vector<long long> v) {
  long long sum = 0;
  long long d = k;
  for (long long c = 0; c <= min(r, kol_vo - 1); c++) {
    sum += v[c];
  }
  for (long long c = 0; c < kol_vo; c++) {
    if (sum >= bin) {
      if (c + r + 1 < kol_vo) sum += v[c + r + 1];
      if (c - r >= 0) sum -= v[c - r];
    } else {
      long long need = bin - sum;
      v[min(c + r, kol_vo - 1)] += need;
      sum += need;
      d -= need;
      if (c + r + 1 < kol_vo) sum += v[c + r + 1];
      if (c - r >= 0) sum -= v[c - r];
    }
    if (d < 0) break;
  }
  if (d < 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> kol_vo >> r >> k;
  vector<long long> v(kol_vo);
  for (long long c = 0; c < kol_vo; c++) cin >> v[c];
  long long L = 0, R = inf;
  while (L + 1 < R) {
    long long mid = (L + R) / 2;
    if (check(mid, v))
      L = mid;
    else
      R = mid;
  }
  cout << L;
  return 0;
}
