#include <bits/stdc++.h>
using namespace std;
int arr[1000000];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != -1) {
    long long sum = 0;
    int ind = -1;
    for (int i = 0; i < n; ++i) {
      scanf("%d", arr + i);
      if (k && arr[i] < 0) {
        arr[i] *= -1;
        k--;
      }
      if (arr[i] == 0) {
        k = 0;
      }
      if (ind == -1 && arr[i] > 0) ind = i;
      sum += arr[i];
    }
    if (k % 2 == 1) {
      sort(arr, arr + n);
      sum -= 2 * arr[0];
    }
    cout << sum << endl;
  }
  return 0;
}
