#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int N = 100010;
const int inf = 0x3f3f3f3f;
using namespace std;
int n, a[N], k;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n);
  int ret = 0, cnt = k;
  for (int i = 0; i < n; i++) {
    if (i < k && a[i] < 0) a[i] = -a[i], cnt--;
  }
  sort(a, a + n);
  for (int i = 1; i < n; i++) ret += a[i];
  if (cnt & 1)
    ret -= a[0];
  else
    ret += a[0];
  cout << ret << endl;
  return 0;
}
