#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int modi(long long int n, long long int m = 1000000007) {
  if (n == 0) return 0;
  n %= m;
  n += m;
  n %= m;
  return n;
}
long long int modu(long long int x, long long int y) {
  if (x >= 0)
    return x % y;
  else
    return (x + 10 * y) % y;
}
long long int fib(long long int n) {
  double phi = (1 + sqrt(5)) / 2;
  return round(pow(phi, n) / sqrt(5));
}
long long int fibn(long long int n) {
  if (n == 0 || n == 1)
    return 1;
  else {
    long long int arr[n + 1];
    arr[0] = 0;
    arr[1] = 1;
    for (long long int i = 2; i <= n; i++) {
      arr[i] = arr[i - 1] + arr[i - 2];
    }
    return arr[n];
  }
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
bool sortbysecdesc(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second > b.second;
}
long long int mpow(long long int base, long long int exp) {
  base %= 998244353;
  long long int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((long long int)result * base) % 998244353;
    base = ((long long int)base * base) % 998244353;
    exp >>= 1;
  }
  return result;
}
long long int modInverse(long long int n) { return mpow(n, 998244353 - 2); }
long long int nCr(long long int n, long long int r) {
  if (r == 0) return 1;
  long long int fac[n + 1];
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % 998244353;
  return (fac[n] * modInverse(fac[r]) % 998244353 * modInverse(fac[n - r]) %
          998244353) %
         998244353;
}
long long int is_prime(long long int a) {
  long long int i;
  if (a == 2 || a == 3)
    return 1;
  else
    for (i = 2; i * i <= a; i++) {
      if (a % i == 0) return 0;
    }
  return 1;
}
long long int digsum(long long int n) { return floor(log10(n)) + 1; }
long long int multiply(long long int x, long long int res[],
                       long long int res_size);
long long int factorial(long long int n) {
  long long int res[500];
  res[0] = 1;
  long long int res_size = 1;
  for (long long int x = 2; x <= n; x++) res_size = multiply(x, res, res_size);
  for (long long int i = res_size - 1; i >= 0; i--) cout << res[i];
}
long long int multiply(long long int x, long long int res[],
                       long long int res_size) {
  long long int carry = 0;
  for (long long int i = 0; i < res_size; i++) {
    long long int prod = res[i] * x + carry;
    res[i] = prod % 10;
    carry = prod / 10;
  }
  while (carry) {
    res[res_size] = carry % 10;
    carry = carry / 10;
    res_size++;
  }
  return res_size;
}
long long int binsearch(long long int arr[], long long int l, long long int r,
                        long long int no) {
  while (l <= r) {
    long long int mid = (l + r) / 2;
    if (arr[mid] == no)
      return mid;
    else if (arr[mid] < no)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return -1;
}
string sortString(string &str) {
  long long int i = 0, j = 0, k = 0;
  long long int charCount[26] = {0};
  for (long long int i = 0; i < str.length(); i++) charCount[str[i] - 'a']++;
  for (long long int i = 0; i < 26; i++) {
    for (long long int j = 0; j < charCount[i]; j++) {
      str[k++] = char('a' + i);
    }
  }
  return str;
}
using cd = complex<double>;
const double PI = acos(-1);
void fft(vector<cd> &a, bool invert) {
  long long int n = a.size();
  if (n == 1) return;
  vector<cd> a0(n / 2), a1(n / 2);
  for (long long int i = 0; 2 * i < n; i++) {
    a0[i] = a[2 * i];
    a1[i] = a[2 * i + 1];
  }
  fft(a0, invert);
  fft(a1, invert);
  double ang = 2 * PI / n * (invert ? -1 : 1);
  cd w(1), wn(cos(ang), sin(ang));
  for (int i = 0; 2 * i < n; i++) {
    a[i] = a0[i] + w * a1[i];
    a[i + n / 2] = a0[i] - w * a1[i];
    if (invert) {
      a[i] /= 2;
      a[i + n / 2] /= 2;
    }
    w *= wn;
  }
}
vector<long long int> multpoly(vector<long long int> const &a,
                               vector<long long int> const &b) {
  vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
  long long int n = 1;
  while (n < a.size() + b.size()) n <<= 1;
  fa.resize(n);
  fb.resize(n);
  fft(fa, false);
  fft(fb, false);
  for (long long int i = 0; i < n; i++) fa[i] *= fb[i];
  fft(fa, true);
  vector<long long int> result(n);
  for (long long int i = 0; i < n; i++) result[i] = round(fa[i].real());
  return result;
}
const long long int N = 2e5 + 5;
bool vis[N];
vector<long long int> adj[N];
vector<long long int> primesv(long long int n) {
  vector<long long int> v;
  long long int x = n;
  for (long long int i = 2; i <= sqrt(n) + 1; i++) {
    if (x % i == 0) {
      x = x / i;
      v.push_back(i);
    }
  }
  return v;
}
const int INF = 1e9 + 5;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i = 0, j = 0;
  long long int n, k;
  cin >> n >> k;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  long long int sum = 0, idx = -1, min = 10000000;
  for (long long int i = 0; i < n; i++) {
    if (v[i] < 0 && k > 0) {
      v[i] = (-1) * v[i];
      k--;
    }
    if (v[i] < min) {
      min = v[i];
      idx = i;
    }
  }
  while (k--) v[idx] = (-1) * v[idx];
  for (long long int i = 0; i < n; i++) sum += v[i];
  cout << sum << '\n';
}
