#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[1000001];
int main() {
  int i, j, k;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  int ans = 0;
  int o = 9999999999, u;
  for (i = 1; i <= n; i++) {
    if (o > abs(a[i])) {
      o = abs(a[i]);
      u = i;
    }
    if (m > 0) {
      if (a[i] < 0) {
        m--;
        a[i] = -a[i];
      }
      ans += a[i];
    } else {
      ans += a[i];
    }
  }
  if (m % 2 == 1) {
    ans -= o * 2;
  }
  cout << ans << endl;
  return 0;
}
