#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double EPS = 1e-11;
const double PI = 2 * acos(0.0);
using ll = long long;
using ull = unsigned long long;
int main() {
  int n, k;
  cin >> n >> k;
  std::vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n && k && v[i] < 0; i++, k--) {
    v[i] *= -1;
  }
  sort(v.begin(), v.end());
  while (k--) {
    v[0] *= -1;
  }
  ll ans = 0;
  for (auto first : v) ans += first;
  cout << ans << endl;
  return 0;
}
