#include <bits/stdc++.h>
using namespace std;
ifstream in("input.txt");
int n, len;
long long a[100010];
int k;
bool active[100010];
priority_queue<pair<long long, int> > used;
priority_queue<pair<long long, int> > unused;
int i = 0;
bool out(pair<long long, int> x) {
  if (x.second > i - len and x.second <= i) return false;
  return true;
}
void clean() {
  while (!unused.empty() and out(unused.top())) unused.pop();
  while (!used.empty() and out(used.top())) used.pop();
}
void init() {
  i = -1;
  clean();
}
long long check() {
  vector<long long> act;
  act.assign(a + max(i - len + 1, 0), a + i + 1);
  sort(act.begin(), act.end());
  int i = act.size() - 1;
  long long vera = 0;
  int scelti = 0;
  while (i >= 0 and act[i] > 0 and scelti < k) {
    scelti++;
    vera += act[i];
    i--;
  }
  return vera;
}
vector<long long> f() {
  vector<long long> res;
  long long somma = 0;
  int quanti = 0;
  for (i = 0; i < n; i++) {
    if (a[i] > 0) unused.push(make_pair(a[i], i));
    if (i - len >= 0 and active[i - len]) {
      quanti--;
      somma -= a[i - len];
      active[i - len] = false;
    }
    clean();
    while (!used.empty() and !unused.empty() and
           -used.top().first < unused.top().first) {
      pair<long long, int> x, y;
      x = used.top();
      y = unused.top();
      used.pop();
      unused.pop();
      somma += y.first + x.first;
      x.first *= -1;
      y.first *= -1;
      clean();
      used.push(y);
      unused.push(x);
      active[x.second] = false;
      active[y.second] = true;
    }
    while (quanti < k and !unused.empty()) {
      pair<long long, int> y = unused.top();
      unused.pop();
      somma += y.first;
      y.first *= -1;
      used.push(y);
      quanti++;
      active[y.second] = true;
      clean();
    }
    if (i >= len - 1) res.push_back(somma);
  }
  return res;
}
int main() {
  cin >> n >> len;
  long long b[n];
  for (i = 0; i < n; i++) cin >> b[i];
  cin >> k;
  for (i = 0; i < n; i++) a[i] = b[i];
  init();
  vector<long long> toSottr = f();
  for (i = 0; i < n; i++) a[i] = -b[i];
  init();
  vector<long long> toSum = f();
  for (i = 1; i < n; i++) b[i] += b[i - 1];
  vector<long long> valori;
  for (int i = 0; i <= n - len; i++) {
    long long s;
    if (i > 0)
      s = b[i + len - 1] - b[i - 1];
    else
      s = b[i + len - 1];
    valori.push_back(abs(s - 2 * toSottr[i]));
    valori.push_back(abs(s + 2 * toSum[i]));
  }
  sort(valori.begin(), valori.end());
  cout << valori[valori.size() - 1];
}
