#include <bits/stdc++.h>
using namespace std;
int n, len, k;
long long result;
int a[100001], q[100001], id[100001], idx[100001];
long long f[100001], t[100001];
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
bool cmp(int u, int v) { return a[u] > a[v]; }
void insert(int i) {
  if (i == 0 || a[i] >= 0) return;
  int val = a[i];
  i = idx[i];
  while (i <= n) {
    id[i]++;
    f[i] += val;
    i += i & -i;
  }
}
void remove(int i) {
  if (i == 0 || a[i] >= 0) return;
  int val = a[i];
  i = idx[i];
  while (i <= n) {
    id[i]--;
    f[i] -= val;
    i += i & -i;
  }
}
int getid(int i) {
  int ret = 0;
  while (i > 0) {
    ret += id[i];
    i -= i & -i;
  }
  return ret;
}
long long getsum(int i) {
  long long ret = 0;
  while (i > 0) {
    ret += f[i];
    i -= i & -i;
  }
  return ret;
}
long long getmax() {
  long long sum = 0;
  int neg = 0;
  for (int i = 1; i <= len - 1; i++) {
    sum += abs(a[i]);
    neg += int(a[i] < 0);
  }
  for (int i = 1; i <= n - len + 1; i++) {
    sum -= abs(a[i - 1]);
    neg -= int(a[i - 1] < 0);
    sum += abs(a[i + len - 1]);
    neg += int(a[i + len - 1] < 0);
    t[i] = sum;
    if (neg <= k)
      q[i] = 0;
    else
      q[i] = neg - k;
  }
  for (int i = 1; i <= n; i++) id[i] = i;
  sort(id + 1, id + 1 + n, cmp);
  for (int i = 1; i <= n; i++) idx[id[i]] = i;
  memset(f, 0, sizeof f);
  memset(id, 0, sizeof id);
  for (int i = 1; i <= len - 1; i++) insert(i);
  long long ret = 0;
  for (int i = 1; i <= n - len + 1; i++) {
    remove(i - 1);
    insert(i + len - 1);
    int l = 0;
    int r = n;
    while (l < r) {
      int mid = (l + r) / 2;
      if (getid(mid) < q[i])
        l = mid + 1;
      else
        r = mid;
    }
    long long ss = getsum(l);
    ret = max(ret, t[i] + 2 * ss);
  }
  return ret;
}
int main() {
  cin >> n >> len;
  a[0] = 0;
  for (int i = 1; i <= n; i++) cin >> a[i];
  cin >> k;
  result = getmax();
  for (int i = 1; i <= n; i++) a[i] = -a[i];
  result = max(result, getmax());
  cout << result;
  return 0;
}
