#include <bits/stdc++.h>
using namespace std;
const long long inf = 4e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  long long i, o = 0, pos = inf;
  vector<long long> neg;
  for (i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a < 0)
      neg.emplace_back(a);
    else
      o += a;
    pos = min(pos, abs(a));
  }
  sort(neg.begin(), neg.end());
  for (i = 0; i < neg.size(); i++) {
    if (!k)
      o += neg[i];
    else {
      o += -neg[i];
      k--;
    }
  }
  if (k & 1) o -= 2 * pos;
  cout << o << endl;
}
