#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, arr[100001], res = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (k != 0 && arr[i] < 0) {
      arr[i] *= -1;
      k--;
    }
  }
  if (k % 2 == 0) {
    for (int i = 0; i < n; i++) res += arr[i];
  } else {
    int mini = 1e8;
    for (int i = 0; i < n; i++) {
      if (arr[i] <= mini) mini = arr[i];
    }
    for (int i = 0; i < n; i++) {
      if (arr[i] == mini) {
        arr[i] *= -1;
        break;
      }
    }
    for (int i = 0; i < n; i++) res += arr[i];
  }
  cout << res << endl;
  return 0;
}
