#include <bits/stdc++.h>
int main() {
  using std::cin;
  using std::cout;
  int n, k;
  cin >> n >> k;
  int change_count = 0;
  int sum = 0;
  std::vector<int> numbers;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    if (a < 0 && change_count < k) {
      ++change_count;
      a = -a;
    }
    numbers.push_back(a);
  }
  std::sort(numbers.begin(), numbers.end());
  if ((k - change_count) % 2 == 1) numbers[0] = -numbers[0];
  for (int i = 0; i < n; ++i) sum += numbers[i];
  cout << sum;
  return 0;
}
