#include <bits/stdc++.h>
using namespace std;
const long long int inf = 2000000;
long long int i = 0, T = 0, N = 0, tc = 0, t = 0;
long long int n = 0, k = 0;
string s;
int main() {
  long long int n;
  cin >> n;
  long long int arr[n];
  long long int k;
  cin >> k;
  for (auto &x : arr) cin >> x;
  long long int sum = 0;
  for (long long int i = 0; i < n; i++) {
    if (arr[i] < 0 && k) {
      arr[i] *= (-1LL);
      k--;
    } else
      break;
  }
  sort(arr, arr + n);
  if (k % 2) arr[0] *= (-1LL);
  for (long long int i = 0; i < n; i++) {
    sum += arr[i];
  }
  cout << sum;
}
