#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, n, t, b, c, d, i, j, k, x, y, z, l, q, r;
  long long cnt = 0, ans = 0;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  x = k;
  for (long long i = 0; i < min(n, k); i++)
    if (a[i] < 0) a[i] = abs(a[i]), x--;
  sort(a, a + n);
  if (x > 0) {
    for (long long i = 1; i <= n - 1; i++) ans += a[i];
    if (x % 2 == 1)
      ans -= a[0];
    else
      ans += a[0];
  } else
    for (long long i = 0; i < n; i++) ans += a[i];
  printf("%lld\n", ans);
  return 0;
}
