#include <bits/stdc++.h>
using namespace std;
const int _N = 100010;
const long long INF = 2000000010;
int n, len, k;
long long a[_N], ans;
set<pair<long long, int>, greater<pair<long long, int> > > able;
set<pair<long long, int>, less<pair<long long, int> > > used;
void solve() {
  able.clear();
  used.clear();
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    able.insert(pair<long long, int>(-a[i] * 2, i));
    set<pair<long long, int>, greater<pair<long long, int> > >::iterator x =
        able.upper_bound(pair<long long, int>(INF, -1));
    if (x->first > 0) {
      if (used.size() < k) {
        sum += x->first;
        used.insert(pair<long long, int>(x->first, x->second));
        able.erase(x);
      } else if (used.size() > 0) {
        set<pair<long long, int>, less<pair<long long, int> > >::iterator y =
            used.upper_bound(pair<long long, int>(-INF, -1));
        if (x->first > y->first) {
          sum -= y->first;
          able.insert(pair<long long, int>(y->first, y->second));
          used.erase(y);
          sum += x->first;
          used.insert(pair<long long, int>(x->first, x->second));
          able.erase(x);
        }
      }
    }
    if ((i + 1 >= len) && (sum > ans)) ans = sum;
    if (i - len + 1 >= 0) {
      sum -= a[i - len + 1];
      if (used.erase(pair<long long, int>(-a[i - len + 1] * 2, i - len + 1)))
        sum -= -a[i - len + 1] * 2;
      else
        able.erase(pair<long long, int>(-a[i - len + 1] * 2, i - len + 1));
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> len;
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> k;
  ans = 0;
  solve();
  for (int i = 0; i < n; i++) a[i] = -a[i];
  solve();
  cout << ans << endl;
  return 0;
}
