#include <bits/stdc++.h>
const int mod = 1e9 + 7;
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  int a[n];
  int dem = 0;
  int res = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < 0) dem++;
  }
  sort(a, a + n);
  if (dem == k) {
    for (int i = 0; i < n; i++) {
      res += abs(a[i]);
    }
    cout << res << endl;
  } else if (dem > k) {
    for (int i = 0; i < k; i++) {
      res += abs(a[i]);
    }
    for (int i = k; i < n; i++) {
      res += a[i];
    }
    cout << res << endl;
  } else {
    for (int i = 0; i < dem; i++) a[i] *= -1;
    k -= dem;
    sort(a, a + n);
    if (k % 2 == 1) a[0] *= -1;
    for (int i = 0; i < n; i++) {
      res += a[i];
    }
    cout << res << endl;
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
