#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long double PI = 3.141592653589793;
const long long int INF = 9223372036854775807ll;
void solve() {
  int n, ans = 0, k;
  cin >> n >> k;
  int v[n];
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n; i++) {
    if (v[i] < 0 && k) {
      v[i] *= -1;
      k--;
    }
  }
  sort(v, v + n);
  if (k) v[0] = (k % 2) ? v[0] *= -1 : v[0];
  for (auto i : v) ans += i;
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
