#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, i, mn = 99999999;
  cin >> N >> K;
  int a, sum = 0;
  for (i = 0; i < N; i++) {
    cin >> a;
    if (a<0 & K> 0) {
      a *= -1;
      K--;
    }
    sum += a;
    mn = min(mn, abs(a));
  }
  if (K % 2) sum -= 2 * mn;
  cout << sum << endl;
  return 0;
}
