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