#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[100010] = {0};
int Min = 100010, fMin = 0;
int cnt = 0;
int ans = 0;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (Min > abs(a[i])) {
      Min = abs(a[i]);
      if (a[i] < 0)
        fMin = -1;
      else
        fMin = 1;
    }
    if (a[i] < 0) cnt++;
  }
  if (cnt == 0) {
    for (int i = 0; i < n; i++) ans += a[i];
    ans -= Min;
    if (k % 2 == 0)
      ans += Min;
    else
      ans -= Min;
    cout << ans << endl;
  } else {
    if (k <= cnt) {
      for (int i = 0; i < k; i++) a[i] = -a[i];
      for (int i = 0; i < n; i++) ans += a[i];
      cout << ans << endl;
    } else {
      k -= cnt;
      for (int i = 0; i < n; i++) ans += abs(a[i]);
      ans -= Min;
      if (k % 2 == 0)
        ans += Min;
      else
        ans -= Min;
      cout << ans << endl;
    }
  }
  return 0;
}
