#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a[100000], sum = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n && k && a[i] < 1; i++, k--) a[i] = abs(a[i]);
  (k & 1) ? a[min_element(a, a + n) - a] *= -1
          : a[min_element(a, a + n) - a] *= 1;
  for (int i = 0; i < n; i++) sum += a[i];
  cout << sum << endl;
  return 0;
}
