#include <bits/stdc++.h>
using namespace std;
const int MAX_DIST = 1e9 + 7;
long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
int n, k;
int a[100001];
int main() {
  cin >> n >> k;
  int sum = 0, mn = 999999;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (a[i] < 0 && k > 0) a[i] = abs(a[i]), k--;
    sum += a[i];
    mn = min(mn, abs(a[i]));
  }
  if (k & 1) sum -= 2 * mn;
  cout << sum << endl;
  return 0;
}
