#include <bits/stdc++.h>
using namespace std;
bool prime(int m) {
  int u = sqrt(m);
  for (int i = 2; i <= u + 1; i++) {
    if (m % i == 0) {
      return false;
    }
  }
  return true;
}
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long min(long long a, long long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}
bool file = false;
int main() {
  if (file) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  int n, k;
  cin >> n >> k;
  int a[n + 1];
  int b = -1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i - 1];
    if (a[i - 1] < 0) {
      b = i + 1;
    }
  }
  b--;
  if (b >= k) {
    for (int i = 1; i <= k; i++) {
      a[i - 1] = a[i - 1] * -1;
    }
  } else {
    for (int i = 1; i <= b; i++) {
      a[i - 1] = a[i - 1] * -1;
    }
    k -= b;
    sort(a, a + n);
    k = k % 2;
    for (int i = 1; i <= k; i++) {
      a[i - 1] = a[i - 1] * -1;
    }
  }
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += a[i - 1];
  }
  cout << sum << endl;
  return 0;
}
