#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int n, k, i, t, min1, j, s = 0;
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> a[i];
  i = 1;
  t = k;
  while (a[i] < 0 && t > 0) {
    a[i] = a[i] * -1;
    t--;
    i++;
  }
  if (t > 0) {
    min1 = a[1];
    j = 1;
    for (i = 2; i <= n; i++)
      if (a[i] < min1) {
        min1 = a[i];
        j = i;
      }
    if (t % 2 == 1) a[j] = a[j] * -1;
  }
  for (i = 1; i <= n; i++) s = s + a[i];
  cout << s;
  return 0;
}
