#include <bits/stdc++.h>
using namespace std;
void impgraph(int n, int m);
void dfs(int u, int par);
const int mod = 1e9;
const int N = 3e5 + 1;
vector<int> g[N];
int a[N];
void solve() {
  int n, m, ans = 0, cnt = 0, k;
  cin >> n >> k;
  for (int i = 0; 0 < n ? i < n : i > n; 0 < n ? i += 1 : i -= 1) {
    cin >> a[i];
    if (a[i] < 0 && k) {
      k--;
      a[i] *= -1;
      ans += a[i];
    } else
      ans += a[i];
  }
  sort(a, a + n);
  if (k % 2 == 0)
    cout << ans;
  else
    cout << ans - 2 * a[0];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
void impgraph(int n, int m) {
  int i, u, v;
  while (m--) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
}
void dfs(int u, int par) {
  for (int v : g[u]) {
    if (a[v]) {
    }
    dfs(v, 0);
  }
}
