#include <bits/stdc++.h>
using namespace std;
vector<long long> arr;
long long n, m, w;
bool confirm(long long t) {
  vector<long long> find = arr;
  queue<long long> addq;
  long long add = 0;
  long long wt = m;
  for (long long i = 0; i < arr.size(); i++) {
    if (i >= w) {
      add -= (addq.front());
      addq.pop();
    }
    find[i] += add;
    if (t - find[i] > 0) {
      addq.push(t - find[i]);
      add += (t - find[i]);
      wt -= (t - find[i]);
      if (wt < 0) return false;
    } else {
      addq.push(0);
    }
  }
  return true;
}
int main() {
  cin >> n >> m >> w;
  long long mini = INT_MAX;
  if (w > n) w = n;
  for (long long i = 0; i < n; i++) {
    long long t;
    cin >> t;
    arr.push_back(t);
    mini = min(mini, arr[i]);
  }
  long long l = mini, r = 2000000010;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    if (confirm(mid))
      l = mid;
    else
      r = mid;
  }
  cout << l << endl;
  return 0;
}
