#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  long long mn = INT_MAX;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mn = min(mn, abs(a[i]));
  }
  int i = 0;
  while (a[i] < 0 && k > 0 && i < n) {
    a[i] *= -1;
    k--;
    i++;
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
  }
  if (k > 0) {
    if (k % 2 == 1) {
      sum -= (2 * mn);
    }
  }
  cout << sum << endl;
  return 0;
}
