#include <bits/stdc++.h>
using namespace std;
const int Size = 1e5;
int main() {
  int n, k, num, sum = 0, mn = INT_MAX;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (num < 0 && k > 0) {
      num *= -1;
      k--;
    }
    sum += num;
    mn = min(mn, num);
  }
  if (k > 0 && k % 2 != 0) sum -= (2 * mn);
  cout << sum << "\n";
  return 0;
}
