#include <bits/stdc++.h>
using namespace std;
int a[100001];
int n, k;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] <= 0 && k > 0) {
      a[i] *= -1;
      k--;
    }
  }
  int ans = 0;
  if (k > 0) {
    sort(a + 1, a + n + 1);
    if (k & 1) a[1] *= -1;
  }
  for (int i = 1; i <= n; i++) ans += a[i];
  printf("%d\n", ans);
  return 0;
}
