#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long n, m, x, i, j, s = 0, c;
  vector<long> v;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  c = m;
  i = 0;
  while (i < n) {
    if ((v[i] < 0 || v[i] == 0) && (m > 0)) {
      v[i] = v[i] * -1;
      m--;
    }
    i++;
  }
  if (m > 0) {
    sort(v.begin(), v.end());
    if (n > 1 && (m % 2 == 0)) {
      for (i = 0; i < n; i++) s = s + v[i];
      cout << s;
    }
    if ((n == 1) && (m % 2 == 0))
      cout << v[0];
    else if (m % 2 != 0) {
      for (i = 1; i < n; i++) s = s + v[i];
      cout << (s - v[0]);
    }
  } else {
    for (i = 0; i < n; i++) s = s + v[i];
    cout << s;
  }
  return 0;
}
