#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, sum = 0;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  for (int i = 0; k > 0 && i < n; i++) {
    if (a[i] < 0) {
      k--;
      a[i] *= -1;
    } else {
      break;
    }
  }
  sort(a.begin(), a.end());
  if (k % 2 != 0) {
    a[0] *= -1;
  }
  for (int i = 0; i < n; i++) {
    sum += a[i];
  }
  cout << sum << endl;
  return 0;
}
