#include <bits/stdc++.h>
using namespace std;
const int Z = (int)3e3 + 228;
const int N = (int)1e6 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;
int n, d;
long long a[N], delta[N], k;
bool can(long long mid) {
  fill(delta + 1, delta + 1 + n, 0LL);
  for (int i = 1; i <= n; i++) {
    delta[max(1, i - d)] += a[i];
    delta[i + d + 1] -= a[i];
  }
  long long cur = 0, res = 0;
  for (int i = 1; i <= n; i++) {
    cur += delta[i];
    if (cur < mid) {
      res += mid - cur;
      if (res > k) return false;
      delta[i + 2 * d + 1] -= mid - cur;
      cur = mid;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long l = 0, r = 2e18 + 5;
  while (l < r) {
    long long mid = (l + r + 1) / 2;
    if (can(mid))
      l = mid;
    else
      r = mid - 1;
  }
  cout << l;
  return 0;
}
