#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
int n, len, K;
long long a[MAXN];
long long psum[MAXN];
multiset<long long>::iterator it;
long long sum1, sum2;
multiset<long long> s1, s2;
void adjust() {
  while ((int)s1.size() < K && (int)s2.size() > 0) {
    sum1 += *s2.rbegin();
    sum2 -= *s2.rbegin();
    s1.insert(*s2.rbegin());
    it = s2.end();
    s2.erase(--it);
  }
  while ((int)s1.size() > K) {
    sum1 -= *s1.begin();
    sum2 += *s1.begin();
    s2.insert(*s1.begin());
    s1.erase(s1.begin());
  }
}
void insert(int v) {
  if (v > 0) {
    sum1 += v;
    sum2 -= v;
    s1.insert(v);
    adjust();
  }
}
void remove(int v) {
  it = s1.find(v);
  if (it != s1.end()) {
    sum1 -= v;
    s1.erase(it);
  } else {
    it = s2.find(v);
    if (it == s2.end()) {
      return;
    }
    sum2 -= v;
    s2.erase(it);
  }
  adjust();
}
long long gao() {
  s1.clear();
  s2.clear();
  sum1 = sum2 = 0;
  for (int i = 0; i < len; ++i) {
    insert(-a[i] * 2);
  }
  long long ret = psum[0] + sum1;
  for (int i = 0; i + len < n; ++i) {
    insert(-a[i + len] * 2);
    remove(-a[i] * 2);
    ret = max(ret, psum[i + 1] + sum1);
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &len);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &a[i]);
  }
  scanf("%d", &K);
  memset(psum, 0, sizeof(psum));
  for (int i = 0; i < len; ++i) {
    psum[0] += a[i];
  }
  for (int i = 0; i + len < n; ++i) {
    psum[i + 1] = psum[i] + a[i + len] - a[i];
  }
  long long res = gao();
  for (int i = 0; i < n; ++i) {
    a[i] = -a[i];
    psum[i] = -psum[i];
  }
  res = max(res, gao());
  printf("%I64d\n", res);
  return 0;
}
