#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  long s = 0;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  int i = 0;
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    if (a[i] < 0 && k) {
      a[i] *= -1;
      k--;
    } else
      break;
  }
  int min_ = 0;
  for (int i = 1; i < n; i++)
    if (a[min_] > a[i]) min_ = i;
  if (k == 0) {
    for (int i = 0; i < n; i++) s += a[i];
  } else {
    if (k % 2 == 0) {
      a[min_] += 0;
    } else
      a[min_] = -a[min_];
    for (int i = 0; i < n; i++) s += a[i];
  }
  cout << s;
  return 0;
}
