#include <bits/stdc++.h>
using namespace std;
int s[100010], n, k;
int main() {
  while (cin >> n >> k) {
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      cin >> s[i];
      if (s[i] < 0) cnt++;
    }
    int sum = 0;
    if (cnt >= k) {
      for (int i = 1; k; i++) {
        s[i] *= -1;
        k--;
      }
      for (int i = 1; i <= n; i++) sum += s[i];
    }
    if (cnt < k) {
      for (int i = 1; i <= n; i++) sum += abs(s[i]);
      if ((k - cnt) % 2) {
        int minn = 100000;
        for (int i = 1; i <= n; i++) {
          int tmp = abs(s[i]);
          minn = min(minn, tmp);
        }
        sum -= 2 * minn;
      }
    }
    cout << sum << endl;
  }
  return 0;
}
