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