#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, sum = 0;
  cin >> n >> k;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (a[i] > 0 || k <= 0)
      break;
    else {
      a[i] = a[i] * (-1);
      k--;
    }
  }
  sort(a, a + n);
  if (k > 0) {
    if (k % 2 == 0)
      a[0] = a[0];
    else
      a[0] = a[0] * (-1);
  }
  for (int i = 0; i < n; i++) sum += a[i];
  cout << sum << "\n";
  return 0;
}
