#include <bits/stdc++.h>
using namespace std;
int n, m, w;
int a[100009];
int b[100009];
int c, ans;
bool judge(int x) {
  int k = m;
  int c = 0;
  memset(b, 0, sizeof(b));
  for (int i = 0; i < n; i++) {
    c += b[i];
    if (x > a[i] + c) {
      int p = x - a[i] - c;
      if (p > k) return false;
      k -= p;
      c += p;
      int minn = min(i + w, n);
      b[minn] -= p;
    }
  }
  return true;
}
int main() {
  while (scanf("%d %d %d", &n, &m, &w) == 3) {
    int low = 0x3f3f3f3f;
    int high = -0x3f3f3f3f;
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      low = min(low, a[i]);
      high = max(high, a[i]);
    }
    high += m;
    int mid;
    while (high >= low) {
      mid = (low + high) / 2;
      if (judge(mid))
        ans = mid, low = mid + 1;
      else
        high = mid - 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
