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