#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 5e5 + 150;
constexpr long long MOD = 998244353;
constexpr long long INF = 1e18;
constexpr long long LOG = 1e15;
bool cmp(pair<int, int> x, pair<int, int> y) { return (x > y); }
long long N, K, R, part[MAXN], arr[MAXN], Tmp_part[MAXN];
bool Check(long long ans) {
  memset(Tmp_part, 0, sizeof Tmp_part);
  long long k = K;
  for (int i = 1; i <= N; i++) {
    if (ans > part[i] + Tmp_part[i]) {
      long long distance = ans - (part[i] + Tmp_part[i]);
      Tmp_part[i] += distance;
      Tmp_part[min(2 * R + 1 + i, N + 1)] -= distance;
      k -= distance;
      if (k < 0) {
        return false;
      }
    }
    Tmp_part[i + 1] += Tmp_part[i];
  }
  return true;
}
void parting() {
  for (int i = 1; i <= N; i++) {
    if (R >= i) {
      part[1] += arr[i];
    } else {
      part[i - R] += arr[i];
    }
    if (i + R < N) {
      part[i + R + 1] -= arr[i];
    }
  }
  for (int i = 1; i <= N; i++) {
    part[i] += part[i - 1];
  }
}
int main() {
  cin >> N >> R >> K;
  for (int i = 1; i <= N; i++) {
    cin >> arr[i];
  }
  parting();
  long long l = *min_element(part + 1, part + 1 + N), r = INF + 1 + LOG;
  while (l + 1 < r) {
    long long mid = (l + r) >> 1;
    if (Check(mid)) {
      l = mid;
    } else {
      r = mid;
    }
  }
  cout << l;
  return 0;
}
