#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, k, sum = 0, inc[100005];
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> inc[i];
  sort(inc, inc + n);
  for (i = 0; i < n && k; i++) {
    if (inc[i] < 0) {
      inc[i] = -inc[i];
      k--;
    }
  }
  k %= 2;
  sort(inc, inc + n);
  if (k) inc[0] = -inc[0];
  for (i = 0; i < n; i++) sum += inc[i];
  cout << sum << endl;
  return 0;
}
