#include <bits/stdc++.h>
using namespace std;
long long arr[100005], bit[100005];
int n, m, w;
void build() {
  for (int i = 1; i <= n; i++) {
    bit[i] = arr[i] - arr[i - (i & -i)];
  }
}
void add(int l, int r, long long v) {
  for (int i = l; i <= n; i += i & -i) {
    bit[i] += v;
  }
  for (int i = r; i <= n; i += i & -i) {
    bit[i] -= v;
  }
}
long long query(int x) {
  long long ret = 0;
  while (x) {
    ret += bit[x];
    x -= x & -x;
  }
  return ret;
}
bool check(long long x) {
  build();
  long long tmp, cnt = m;
  for (int i = 1; i <= n; i++) {
    tmp = query(i);
    if (tmp < x) {
      cnt -= (x - tmp);
      add(i, i + w, x - tmp);
    }
  }
  return cnt >= 0;
}
int main() {
  scanf("%d%d%d", &n, &m, &w);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", arr + i);
  }
  for (int i = n; i > 0; i--) {
    arr[i] -= arr[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    arr[i] += arr[i - 1];
  }
  long long l = 0, r = 2e9;
  while (r - l > 1) {
    long long mid = (l + r) >> 1;
    if (check(mid))
      l = mid;
    else
      r = mid;
  }
  printf("%d\n", l);
  return 0;
}
