#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
long long int n, r, k, a[500005], dp[500005], c[500005];
long long int check(long long int x) {
  memset(c, 0, sizeof(c));
  long long int s1 = k, y = 0;
  for (long long int i = 1; i <= n; i++) {
    c[i] = c[i - 1];
    y = a[i] + c[i] - c[(max(i - 2 * r - 1, 0ll))];
    if (y < x && s1 - (x - y) >= 0) {
      s1 -= (x - y);
      c[i] += (x - y);
    } else if (y < x && s1 - (x - y) < 0) {
      return 0;
    }
  }
  return 1;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> r >> k;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    dp[i] = dp[i - 1] + a[i];
  }
  long long int mn = 1000000000000000005;
  for (long long int i = 1; i <= n; i++) {
    a[i] = dp[min(i + r, n)] - dp[max(i - r - 1, 0ll)];
    mn = min(mn, a[i]);
  }
  long long int l = mn, r = 2 * 1000000000000000005, ans = 0;
  while (l <= r) {
    long long int mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans << '\n';
}
