#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  int minabs = INT_MAX;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    minabs = min(minabs, abs(v[i]));
  }
  for (int i = 0; i < n; i++) {
    if (k == 0) break;
    if (v[i] < 0) {
      v[i] *= -1;
      k--;
    }
  }
  int correction = 0;
  if (k & 1) {
    correction = 2 * minabs;
  }
  long long ans = accumulate(v.begin(), v.end(), 0ll);
  cout << ans - correction;
  return 0;
}
