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