func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 1000 * 100 + 5;   int n, l, k;   long long a[maxn];   void input() {     scanf( %d %d , &n, &l);     for (int i = 0; i < n; i++) scanf( %lld , &a[i]);     scanf( %d , &k);   }   long long first() {     long long javab = 0, MAX = 0, x;     int y;     set<pair<long long, int> > second, t;     for (int i = 0; i < l; i++)       if (a[i] < 0) second.insert(make_pair(a[i], i));     while ((int)second.size() > k) {       t.insert(*(--second.end()));       second.erase(--second.end());     }     for (int i = 0; i < l; i++) {       if (second.find(make_pair(a[i], i)) == second.end())         javab += a[i];       else         javab -= a[i];     }     MAX = abs(javab);     for (int i = l; i < n; i++) {       if (second.find(make_pair(a[i - l], i - l)) == second.end()) {         t.erase(make_pair(a[i - l], i - l));         javab -= a[i - l];       } else {         javab += a[i - l];         second.erase(make_pair(a[i - l], i - l));       }       if (a[i] < 0) {         javab -= a[i];         second.insert(make_pair(a[i], i));       } else         javab += a[i];       if ((int)t.size()) {         x = t.begin()->first;         y = t.begin()->second;         javab -= (2 * x);         second.insert(make_pair(x, y));         t.erase(make_pair(x, y));       }       while ((int)second.size() > k) {         x = (--second.end())->first;         y = (--second.end())->second;         t.insert(make_pair(x, y));         javab += (2 * x);         second.erase(make_pair(x, y));       }       MAX = max(MAX, javab);     }     return MAX;   }   void output() {     long long javab = first();     for (int i = 0; i < n; i++) a[i] *= -1;     printf( %lld n , max(javab, first()));   }   int main() {     ios::sync_with_stdio(false);     input();     output();     return 0;   }   