#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int arr[n + 5];
  int countneg = 0;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    if (arr[i] < 0) countneg++;
  }
  if (k <= countneg) {
    for (int i = 1; i <= k; i++)
      if (arr[i] < 0) arr[i] *= -1;
    cout << accumulate(arr + 1, arr + n + 1, 0) << endl;
    return 0;
  }
  for (int i = 1; i <= countneg; i++) {
    if (arr[i] < 0) {
      arr[i] *= -1;
      k--;
    }
  }
  if (!countneg) countneg++;
  if (k % 2) {
    if (!arr[countneg + 1] ||
        arr[countneg + 1] < arr[countneg] && countneg != n)
      arr[countneg + 1] *= -1;
    else
      arr[countneg] *= -1;
  }
  cout << accumulate(arr + 1, arr + n + 1, 0) << endl;
  return 0;
}
