#include <bits/stdc++.h>
using namespace std;
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
};
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
};
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); };
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int a[n];
  int l0 = 0, n0 = 0, m0 = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] < 0)
      l0++;
    else if (a[i] > 0)
      m0++;
    else
      n0++;
  }
  sort(a, a + n);
  for (int i = 0; i < min(k, l0); i++) a[i] *= -1;
  if (k >= l0) {
    k -= l0;
    if (k % 2 == 1 && n0 == 0) {
      if (m0 == 0)
        a[l0 - 1] *= -1;
      else if (l0 == 0)
        a[0] *= -1;
      else if (a[l0 - 1] < a[l0] && m0 > 0)
        a[l0 - 1] *= -1;
      else
        a[l0] *= -1;
    }
  }
  int t = 0;
  for (int i = 0; i < n; i++) t += a[i];
  printf("%d\n", t);
}
