#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int N = 1e3 + 74, M = 2e5 + 74, OO = 0x3f3f3f3f;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for (long long& x : v) cin >> x;
  sort(v.begin(), v.end());
  for (int i = 0; k && i < n; i++) {
    if (v[i] < 0) {
      v[i] *= -1;
      k--;
    }
  }
  sort(v.begin(), v.end());
  if (k & 1) v[0] *= -1;
  long long acc = 0;
  cout << accumulate(v.begin(), v.end(), acc) << '\n';
  return 0;
}
