#include <bits/stdc++.h>
using namespace std;
long long n, k, a[100100], sum = 0, Min = 1e6;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (a[i] < 0 && k) a[i] *= -1, k--;
    Min = min(Min, abs(a[i]));
    sum += a[i];
  }
  if (k & 1) sum -= Min * 2;
  cout << sum;
  return 0;
}
