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