#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k, ans = 0, m = 1e5, pos;
  cin >> n >> k;
  int ar[n];
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    if (ar[i] < 0 and k > 0) {
      ar[i] = ar[i] * (-1);
      k--;
    }
    if (abs(ar[i]) < m) {
      pos = i;
    }
    m = min(m, abs(ar[i]));
  }
  if (k > 0) {
    for (int i = 0; i < k; i++) {
      ar[pos] *= -1;
    }
  }
  for (int i = 0; i < n; i++) {
    ans += ar[i];
  }
  cout << ans << "\n";
}
