#include <bits/stdc++.h>
using namespace std;
const long long OO = 2e9;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
vector<long long> v;
vector<pair<pair<long long, long long>, long long>> h;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  int min = 0;
  for (int i = 0; i < (int)(n); ++i) cin >> a[i];
  for (int i = 0; i < (int)(n); ++i) {
    if (a[i] < 0 && k > 0) {
      a[i] *= -1;
      k--;
    }
  }
  if (k == 0) {
    long long sum = accumulate(((a).begin()), ((a).end()), 0);
    cout << sum << "\n";
    return 0;
  }
  sort(((a).begin()), ((a).end()));
  if (k % 2 == 0) {
    long long sum = accumulate(((a).begin()), ((a).end()), 0);
    cout << sum << "\n";
    return 0;
  } else {
    a[0] *= -1;
    long long sum = accumulate(((a).begin()), ((a).end()), 0);
    cout << sum << "\n";
    return 0;
  }
}
