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