#include <bits/stdc++.h>
using namespace std;
string itosm(long long x) {
  if (x == 0) return "0";
  string ans = "";
  while (x > 0) {
    ans += ((x % 10) + '0');
    x /= 10;
  }
  reverse(ans.begin(), ans.end());
  return ans;
}
long long stoim(string str) {
  long long ans = 0;
  long long k = 1;
  int p = 0;
  if (str[0] == '-') p++;
  for (int i = str.length() - 1; i >= p; i--) {
    ans += (str[i] - '0') * k;
    k *= 10;
  }
  return ans;
}
const long long infll = 1e18 + 3;
const int inf = 1009000999;
const long double eps = 1e-7;
const int maxn = 1e6 + 1146;
const int baseint = 1000200013;
const long long basell = 1e18 + 3;
const long double PI = acos(-1.0);
const long long mod = 1e9 + 7;
long long a[maxn];
long long t[maxn];
long long f[maxn];
long long n, r, k;
bool check(long long x) {
  for (int i = 0; i < n; i++) f[i] = x - a[i], t[i] = 0;
  long long sum = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    if (f[i] - sum > 0) {
      long long d = f[i] - sum;
      sum += d;
      ans += d;
      t[2 * r + i] += d;
      if (ans > k) return 0;
    }
    sum -= t[i];
  }
  return 1;
}
void solve() {
  cin >> n >> r >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    if (i - r - 1 >= 0) sum -= a[i - r - 1];
    t[i] = sum;
    sum += a[i];
  }
  sum = 0;
  for (int i = n - 1; i >= 0; i--) {
    sum -= a[i + r + 1];
    sum += a[i];
    t[i] += sum;
  }
  for (int i = 0; i < n; i++) a[i] = t[i];
  long long l = 0, r = 1.2e18, mid;
  while (l < r) {
    mid = (l + r + 1) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid - 1;
  }
  cout << l;
}
int main() {
  ios_base::sync_with_stdio(0);
  ;
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
