#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return (N = N | (1 << pos)); }
int Reset(int N, int pos) { return (N = N & ~(1 << pos)); }
bool Check(int N, int pos) { return (bool)(N & (1 << pos)); }
int lsb(int N) { return (N & (-N)); }
int toggle(int N, int pos) { return (N = N ^ (1 << pos)); }
int setall(int N) { return ((1 << N) - 1); }
int flower[100005];
long long int update[100005];
long long int hi = 1e16;
int n, m, w;
bool IsPossible(long long int evalue, long long int left) {
  memset(update, 0, sizeof(update));
  int e = 0;
  for (int i = 0; i < n; i++) {
    if (i) {
      update[i] += update[i - 1];
    }
    long long int need = evalue - flower[i] - update[i];
    if (need > 0) {
      update[i] += need;
      if (i + w <= n) {
        update[i + w] -= need;
      }
      e += need;
      if (e > left) {
        return false;
      }
    }
  }
  return true;
}
int mn = INT_MAX;
int get_ans() {
  int lo = 1;
  int ans;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (IsPossible(mid, m)) {
      ans = mid;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> w;
  for (int i = 0; i < n; i++) {
    cin >> flower[i];
    mn = min(mn, flower[i]);
  }
  cout << get_ans() << endl;
  return 0;
}
