#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
bool isprime(long long n) {
  if (n < 2) return 0;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}
vector<int> factors(int n) {
  vector<int> f;
  for (int i = 2; i * i <= n; i++) {
    while (!(n & (i - 1))) {
      f.push_back(i);
      n /= i;
    }
  }
  if (n > 1) f.push_back(n);
  return f;
}
long long u = 1;
long long modpow(int x, int n, int m) {
  while (n) {
    if (n & 1) u = (u * x) % m;
    x = (x * x) % m;
    n /= 2;
  }
  return u;
}
vector<bool> primes(int n) {
  vector<bool> sieve(n, 0);
  sieve[0] = sieve[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (sieve[i]) continue;
    for (int u = 2 * i; u <= n; u += i) {
      sieve[u] = 1;
    }
  }
  return sieve;
}
int toInt(string s) {
  int n;
  istringstream iss(s);
  iss >> n;
  return n;
}
long long mod = 1000000007;
int main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, x, income = 0, k, c = INT_MAX;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x < 0 && k)
      income += -x, k--;
    else
      income += x;
    c = min(c, abs(x));
  }
  if (k & 1) {
    income += -2 * c;
  }
  cout << income;
  return 0;
}
