#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  long long sum = 0;
  int lesabs = INT_MAX;
  int m = 0;
  for (int i = 0; i < a; i++) {
    cin >> m;
    if (b > 0 && m <= 0) {
      b--;
      sum -= m;
    } else {
      sum += m;
    }
    lesabs = min(lesabs, abs(m));
  }
  if (b % 2 == 1) sum -= 2 * lesabs;
  cout << sum;
  return 0;
}
