#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, arr[100005], min1 = 1e8, neg = 0, cnt = 0, flag = 0, x, y;
  vector<int> posv, negv;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == 0) flag = 1;
    if (arr[i] < 0) {
      neg++;
      negv.push_back(arr[i]);
    } else {
      posv.push_back(arr[i]);
    }
  }
  if (neg > 0) x = *max_element(negv.begin(), negv.end());
  if (neg != n) y = *min_element(posv.begin(), posv.end());
  if (neg == 0) {
    min1 = arr[0];
  } else if (neg != n) {
    min1 = min(abs(x), y);
  } else if (neg == n)
    min1 = abs(arr[n - 1]);
  if (neg >= k) {
    for (int i = 0; i < n; i++) {
      if (k != 0) {
        cnt += abs(arr[i]);
        k--;
      } else
        cnt += arr[i];
    }
  } else if (neg < k && neg > 0) {
    int u = (k - neg);
    k -= u;
    if (u % 2 == 0)
      cnt += (min1);
    else
      cnt += (min1 * -1);
    for (int i = 0; i < n; i++) {
      if (k != 0 && arr[i] < 0) {
        cnt += abs(arr[i]);
        k--;
      } else
        cnt += arr[i];
    }
    cnt -= min1;
  } else if (neg == 0) {
    if (k % 2 == 0)
      cnt += (arr[0]);
    else
      cnt += (arr[0] * -1);
    for (int i = 1; i < n; i++) {
      cnt += arr[i];
    }
  }
  cout << cnt << endl;
  return 0;
}
