#include <bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005], add[100005];
bool ok(int x, int n, int m, int w) {
  for (int i = 1; i <= n; i++) b[i] = a[i];
  memset(add, 0, sizeof(add));
  int now = 0;
  for (int i = 1; i <= n; i++) {
    now += add[i];
    b[i] += now;
    if (b[i] < x) {
      int go = x - b[i];
      b[i] += go;
      m -= go;
      now += go;
      add[min(100005 - 1, i + w)] -= go;
      if (m < 0) return false;
    }
  }
  for (int i = n; i > 0; i--)
    if (b[i] < x) return false;
  return true;
}
int n, w, m;
int main() {
  while (~scanf("%d%d%d", &n, &m, &w)) {
    int minn = 0x7ffFFfff, maxx = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      minn = min(minn, a[i]);
      maxx = max(maxx, a[i]);
    }
    int ans = minn;
    int l = minn, r = maxx + m;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (ok(mid, n, m, w))
        ans = max(ans, mid), l = mid + 1;
      else
        r = mid - 1;
    }
    printf("%d\n", ans);
  }
}
