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