#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
bool isprime(long long a) {
  if (a <= 1) return false;
  for (long long i = 2; i * i <= a; ++i) {
    if (a % i == 0) return false;
  }
  return true;
}
inline void read(int &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = 10 * x + c - '0';
    c = getchar();
  }
  x *= f;
}
int main() {
  int n, k, x, s(0);
  cin >> n >> k;
  vector<int> v;
  int i = 0;
  for (int i = 1; i <= n; i++) {
    read(x);
    v.push_back(x);
    s += x;
  }
  if (v[0] >= 0) {
    cout << s + (k % 2 == 0 ? 0 : -2 * v[0]);
    return 0;
  }
  while (k > 0)
    if (v[i] < 0) {
      v[i] *= -1;
      s += 2 * v[i++];
      k--;
    } else if (v[i] == 0)
      k = 0;
    else
      break;
  if (!k) {
    cout << s;
    return 0;
  }
  sort(v.begin(), v.end());
  cout << s + (k % 2 == 0 ? 0 : -2 * v[0]);
}
