#include <bits/stdc++.h>
using namespace std;
long long int a[100005];
long long int n, m, w;
vector<long long int> ve[2 * 100005];
bool chk(long long int x) {
  vector<long long int> b(n + 1);
  for (long long int i = 1; i <= n; i++) {
    b[i] = a[i];
    ve[i].clear();
  }
  long long int left = m;
  long long int curr = 0;
  for (long long int i = 1; i <= n; i++) {
    for (auto it : ve[i]) curr -= it;
    if (b[i] + curr >= x) continue;
    long long int req = x - (b[i] + curr);
    left -= req;
    curr += req;
    ve[i + w].push_back(req);
  }
  if (left >= 0) return true;
  return false;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> w;
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  long long int lo = 1;
  long long int hi = 2e9;
  while (hi > lo) {
    long long int mid = (lo + hi + 1) / 2;
    if (chk(mid))
      lo = mid;
    else
      hi = mid - 1;
  }
  cout << lo << endl;
  return 0;
}
