#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e15;
const int N = 500005;
long long a[N], num[N];
long long n, rad, k;
bool check(long long x) {
  long long sum = 0, temp = 0;
  long long l = 1, r = rad + 1;
  memcpy(a, num, sizeof(num));
  for (int i = 1; i <= r; i++) sum += a[i];
  for (int i = 1; i <= n; i++) {
    if (sum < x) {
      a[r] += x - sum;
      temp += (x - sum);
      if (temp > k) return false;
      sum = x;
    }
    if (r < n) {
      r++;
      sum += a[r];
    }
    if (i > rad) {
      sum -= a[l];
      l++;
    }
  }
  return true;
}
long long find(void) {
  long long left = INF, right = 0, mid, ans;
  for (int i = 1; i <= n; i++) {
    left = min(left, num[i]);
    right += num[i];
  }
  right += k;
  while (left <= right) {
    mid = (left + right) >> 1;
    if (check(mid)) {
      ans = mid;
      left = mid + 1;
    } else
      right = mid - 1;
  }
  return ans;
}
int main() {
  cin >> n >> rad >> k;
  for (int i = 1; i <= n; i++) scanf("%I64d", &num[i]);
  cout << find() << endl;
  return 0;
}
