#include <bits/stdc++.h>
using namespace std;
const int N = 100002;
int n, len, k, C = 0;
int arr[N];
map<int, int> id;
pair<int, long long> st[4 * N];
int value[N];
void add(int node, int s, int e, int i, int val, int v) {
  if (s > i || e < i) return;
  if (s == e) {
    st[node].first += v;
    st[node].second += v * val;
    return;
  }
  int mid = (s + e) / 2;
  add(2 * node + 1, s, mid, i, val, v);
  add(2 * node + 2, mid + 1, e, i, val, v);
  st[node].first = st[2 * node + 1].first + st[2 * node + 2].first;
  st[node].second = st[2 * node + 1].second + st[2 * node + 2].second;
}
long long maxk(int node, int s, int e, int rem) {
  if (s == e) {
    return 1LL * rem * value[s];
  }
  int mid = (s + e) / 2;
  int l = 2 * node + 1, r = 2 * node + 2;
  if (st[r].first >= rem) return maxk(r, mid + 1, e, rem);
  return st[r].second + maxk(l, s, mid, rem - st[r].first);
}
long long mink(int node, int s, int e, int rem) {
  if (e == s) {
    return 1LL * rem * value[e];
  }
  int mid = (s + e) / 2;
  int l = 2 * node + 1, r = 2 * node + 2;
  if (st[l].first >= rem) return mink(l, s, mid, rem);
  return st[l].second + mink(r, mid + 1, e, rem - st[l].first);
}
long long solve(long long sum, int cntp, int cntn) {
  cntp = min(cntp, k);
  cntn = min(cntn, k);
  long long smax = maxk(0, 0, C - 1, cntp);
  smax = sum - 2 * smax;
  long long smin = mink(0, 0, C - 1, cntn);
  smin = sum - 2 * smin;
  return max(abs(smax), abs(smin));
}
int main() {
  scanf("%d%d", &n, &len);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    id[arr[i]];
  }
  for (auto i : id) {
    id[i.first] = C;
    value[C++] = i.first;
  }
  scanf("%d", &k);
  long long ans = -1e18, sum = 0;
  int cntp = 0, cntn = 0;
  for (int i = 0; i < n; i++) {
    cntp += (arr[i] > 0);
    cntn += (arr[i] < 0);
    sum += arr[i];
    add(0, 0, C - 1, id[arr[i]], arr[i], 1);
    if (i - len >= 0) {
      sum -= arr[i - len];
      cntp -= (arr[i - len] > 0);
      cntn -= (arr[i - len] < 0);
      add(0, 0, C - 1, id[arr[i - len]], arr[i - len], -1);
    }
    if (i >= len - 1) {
      ans = max(ans, solve(sum, cntp, cntn));
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
