#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 10;
int n, k;
vector<int> v;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0, x; i < n; i++) {
    scanf("%d", &x);
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  int t = k;
  for (int i = 0; i < n; i++) {
    if (v[i] < 0 && t) {
      v[i] = v[i] * -1;
      t--;
    }
  }
  sort(v.begin(), v.end());
  if (t % 2 != 0) {
    v[0] *= -1;
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += v[i];
  }
  printf("%d\n", sum);
  return 0;
}
