#include <bits/stdc++.h>
using namespace std;
const int mxn = 100010;
int a[mxn], c[mxn], n, w, m, sum, mi, cnt;
bool sol() {
  int i;
  memset(c, 0, sizeof(c));
  sum = cnt = 0;
  for (i = 1; i <= n; i++) {
    if (i > w) sum -= c[i - w];
    if (mi > sum + a[i]) c[i] = mi - sum - a[i];
    cnt += c[i];
    if (cnt > m) return 0;
    sum += c[i];
  }
  return 1;
}
int main() {
  int i, mn = 1e9, l, r;
  scanf("%d%d%d", &n, &m, &w);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    mn = min(mn, a[i]);
  }
  l = mn;
  r = mn + m;
  while (l < r) {
    mi = (l + r + 1) / 2;
    if (sol())
      l = mi;
    else
      r = mi - 1;
  }
  printf("%d\n", l);
  return 0;
}
