#include <bits/stdc++.h>
using namespace std;
const int Max = 5e5 + 3;
long long n, r, k, arr[Max], tempArr[Max];
bool canCover(long long defence) {
  long long tempK = k;
  for (int i = 1; i <= n; ++i) {
    tempArr[i] = arr[i];
  }
  long long sum = 0;
  for (int i = 1; i <= min(n, 1 + r - 1); ++i) {
    sum += tempArr[i];
  }
  for (int i = 1; i <= n; ++i) {
    if (i + r <= n) sum += tempArr[i + r];
    if (sum < defence) {
      long long diff = defence - sum;
      if (diff > tempK) return false;
      tempK -= diff;
      int right = min(n, i + r);
      tempArr[right] += diff;
      sum += diff;
    }
    if (i - r >= 1) sum -= tempArr[i - r];
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> r >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
  }
  long long start = 0, end = 2e18, mid;
  while (end - start > 1) {
    mid = (start + end) >> 1;
    if (canCover(mid)) {
      start = mid;
    } else
      end = mid;
  }
  cout << start << '\n';
  return 0;
}
