#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, ans = 0, min;
  cin >> n >> k;
  vector<int> v(n);
  int ind = n, f = 0, mi = INT_MAX;
  for (int i = 0; (0 <= n - 1 ? i <= n - 1 : i >= n - 1);
       i = (0 <= n - 1 ? i + 1 : i - 1)) {
    cin >> v[i];
    if (k && v[i] < 0) {
      v[i] = -v[i];
      k--;
    }
    ans += v[i];
    if (v[i] < mi) {
      mi = v[i];
    }
  }
  if (k & 1) ans -= 2 * mi;
  cout << ans;
  return 0;
}
