#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, k;
  vector<int> v;
  while (cin >> n >> k) {
    v.clear();
    for (int i = 0; i < n; ++i) {
      cin >> x;
      v.push_back(x);
    }
    x = 0;
    for (int i = 0; i < k; ++i) {
      if (v[x] < 0) {
        v[x] *= -1;
        ++x;
      } else {
        sort(v.begin(), v.end());
        if ((k - i) % 2 != 0) v[0] *= -1;
        break;
      }
    }
    x = 0;
    for (int i = 0; i < n; ++i) x += v[i];
    cout << x << "\n";
  }
}
