#include <bits/stdc++.h>
using namespace std;
long long power(long x, long n) {
  if (n == 0) return 1;
  if (n == 1) return x;
  long n2 = n / 2;
  long long po = power(x, n2);
  if (n % 2) return po * po * x;
  return po * po;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  a %= b;
  return gcd(b, a);
}
class BRomaAndChangingSigns {
 public:
  void solve(std::istream &cin, std::ostream &cout) {
    int n, k, i, x = 0, z = 0;
    cin >> n >> k;
    vector<int> V(n);
    for (i = 0; i < n; i++) {
      cin >> V[i];
      if (V[i] < 0)
        x++;
      else if (V[i] == 0)
        z++;
    }
    sort(V.begin(), V.end());
    if (x) {
      i = 0;
      while (x && k && i < n) {
        x--;
        k--;
        V[i] *= -1;
        i++;
      }
    }
    sort(V.begin(), V.end());
    if (k % 2) V[0] *= -1;
    int sm = 0;
    for (i = 0; i < n; i++) sm += V[i];
    cout << sm << '\n';
  }
};
int main() {
  BRomaAndChangingSigns solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
