#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void solve();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
}
void solve() {
  int n, k;
  cin >> n >> k;
  int a[n];
  int neg = 0, z = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < 0) neg++;
    if (a[i] == 0) z++;
  }
  int sum = 0;
  if (z > 0 || neg >= k) {
    for (int i = 0; i < n; i++) {
      if (k > 0 && a[i] < 0) {
        a[i] *= -1;
      }
      sum += a[i];
      k--;
    }
  } else {
    k = k - neg;
    for (int i = 0; i < n; i++) {
      if (a[i] < 0) {
        a[i] *= -1;
      }
      sum += a[i];
    }
    if (k % 2 == 1) {
      sum = sum - 2 * (a[min_element(a, a + n) - a]);
    }
  }
  cout << sum << '\n';
}
