#include <bits/stdc++.h>
using namespace std;
int N, len, K, arr[100002], marr[100002];
int state[100002], PC, NC, cnt, num[100002][2], C[3];
long long acc[100002];
map<int, int> id;
set<int> positive, negative;
pair<long long, int> tree[400002][2];
void update(int ind, int s, int e, int E, int val, int T) {
  if (s > e || s > E || e < E || T == 2) return;
  if (s == e) {
    tree[ind][T].second += val;
    tree[ind][T].first = (long long)tree[ind][T].second * num[E][T];
    return;
  }
  update(ind * 2, s, (s + e) / 2, E, val, T);
  update(ind * 2 + 1, (s + e) / 2 + 1, e, E, val, T);
  tree[ind][T].first = tree[ind * 2][T].first + tree[ind * 2 + 1][T].first;
  tree[ind][T].second = tree[ind * 2][T].second + tree[ind * 2 + 1][T].second;
}
long long query(int ind, int s, int e, int K, int T) {
  if (s > e || K <= 0 || T == 2) return 0;
  if (K >= tree[ind][T].second) return tree[ind][T].first;
  if (s == e && K < tree[ind][T].second)
    return K * tree[ind][T].first / tree[ind][T].second;
  if (!T)
    return query(ind * 2, s, (s + e) / 2, K, T) +
           query(ind * 2 + 1, (s + e) / 2 + 1, e, K - tree[ind * 2][T].second,
                 T);
  return query(ind * 2, s, (s + e) / 2, K - tree[ind * 2 + 1][T].second, T) +
         query(ind * 2 + 1, (s + e) / 2 + 1, e, K, T);
}
int main() {
  scanf("%d %d", &N, &len);
  for (int i = 0; i < N; i++) scanf("%d", &arr[i]);
  scanf("%d", &K);
  for (int i = 0; i < N; i++) {
    if (arr[i] < 0)
      negative.insert(arr[i]), state[i] = 0, NC++;
    else if (arr[i] > 0)
      positive.insert(arr[i]), state[i] = 1, PC++;
    else
      state[i] = 2;
    acc[i + 1] = arr[i] + acc[i];
  }
  C[0] = NC - 1;
  C[1] = PC - 1;
  cnt = 0;
  for (set<int>::iterator it = negative.begin(); it != negative.end(); it++)
    id[*it] = cnt, num[cnt][0] = *it, cnt++;
  cnt = 0;
  for (set<int>::iterator it = positive.begin(); it != positive.end(); it++)
    id[*it] = cnt, num[cnt][1] = *it, cnt++;
  for (int i = 0; i < N; i++) marr[i] = id[arr[i]];
  for (int i = 0; i < len; i++) update(1, 0, C[state[i]], marr[i], 1, state[i]);
  int i = len;
  long long ret = 0;
  do {
    long long make_neg = -query(1, 0, PC, K, 1) * 2;
    long long make_pos = -query(1, 0, NC, K, 0) * 2;
    ret = max(ret, max(abs(acc[i] - acc[i - len] + make_neg),
                       abs(acc[i] - acc[i - len] + make_pos)));
    update(1, 0, C[state[i - len]], marr[i - len], -1, state[i - len]);
    update(1, 0, C[state[i]], marr[i], 1, state[i]);
    i++;
  } while (i <= N);
  printf("%I64d\n", ret);
}
