#include <bits/stdc++.h>
using namespace std;
struct TreeNode {
  int val;
  TreeNode* left;
  TreeNode* right;
  TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
struct ListNode {
  int val;
  ListNode* next;
  ListNode(int x) : val(x), next(NULL) {}
};
int nxt() {
  int x;
  cin >> x;
  return x;
}
long long nxtLong() {
  long long x;
  cin >> x;
  return x;
}
string nxtStr() {
  string x;
  cin >> x;
  return x;
}
char nxtChar() {
  char x;
  cin >> x;
  return x;
}
double nxtDouble() {
  double x;
  cin >> x;
  return x;
}
long double nxtLDouble() {
  long double x;
  cin >> x;
  return x;
}
TreeNode* makeTree(int n) {
  queue<TreeNode*> tree_nodes;
  TreeNode* root;
  if (n) {
    root = new TreeNode(nxt());
    tree_nodes.push(root);
  } else {
    return NULL;
  }
  while (!tree_nodes.empty()) {
    TreeNode* node = tree_nodes.front();
    tree_nodes.pop();
    bool left;
    cin >> left;
    if (left) {
      node->left = new TreeNode(nxt());
      tree_nodes.push(node->left);
    }
    bool right;
    cin >> right;
    if (right) {
      node->right = new TreeNode(nxt());
      tree_nodes.push(node->right);
    }
  }
  return root;
}
ListNode* makeLinkedList(int n) {
  ListNode* list = new ListNode(0);
  ListNode* dummy = list;
  for (int i = 0; i < n; ++i) {
    list->next = new ListNode(nxt());
    list = list->next;
  }
  return dummy->next;
}
void solve() {
  int n = nxt(), rin = nxt();
  long long k = nxtLong();
  vector<long long> in(n + 1);
  for (int i = 1; i <= n; ++i) {
    cin >> in[i];
  }
  vector<long long> pre(n + 1);
  for (int i = 1; i <= n; ++i) {
    pre[i] += pre[i - 1] + in[i];
  }
  vector<long long> fin(n);
  for (int i = 0; i < n; ++i) {
    int ri = min(i + rin, n - 1);
    int li = max(i - rin, 0);
    fin[i] = pre[ri + 1] - pre[li];
  }
  long long l = 0, r = 2e18, ans = 0;
  function<bool(long long)> check = [&](long long mid) {
    vector<long long> d(1000050);
    int r = rin;
    long long x = 0, res = k, add = 0;
    for (int i = 0; i < n; ++i) {
      x += d[i];
      if (mid - fin[i] - x > 0) {
        long long diff = mid - fin[i] - x;
        if (diff > res) {
          return false;
        }
        res -= diff;
        x += diff;
        d[i + 2 * r + 1] -= diff;
      }
    }
    return true;
  };
  while (l <= r) {
    long long mid = l + (r - l) / 2;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(9);
  solve();
  return 0;
}
