#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  solve();
  return 0;
}
void solve() {
  long long i, n, k, t, d;
  cin >> n >> k;
  vector<int> a(n);
  for (i = 0; i < n; i++) {
    cin >> t;
    if (k > 0 && t < 0) {
      t *= -1;
      k -= 1;
    }
    a[i] = t;
  }
  sort(a.begin(), a.end());
  if (k > 0 && k & 1) {
    a[0] *= -1;
  }
  d = accumulate(a.begin(), a.end(), 0ll);
  cout << d << "\n";
}
