#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int rem = 0;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    if (rem < k) {
      if (i == n - 1) {
        arr[i] = (k - rem) % 2 == 0 ? arr[i] : arr[i] * -1;
        rem = k;
      } else if (i < n - 1 && arr[i] < 0 && arr[i + 1] > 0) {
        if ((k - rem) % 2 == 0) {
          if (abs(arr[i]) > arr[i + 1]) {
            arr[i] *= -1;
            arr[i + 1] *= -1;
          }
        } else {
          arr[i] *= -1;
        }
        rem = k;
      } else if (arr[i] > 0) {
        arr[i] = ((k - rem) % 2 == 0) ? arr[i] : arr[i] * -1;
        rem = k;
      } else {
        arr[i] *= -1;
        rem++;
      }
    }
    sum += arr[i];
  }
  cout << sum;
  return 0;
}
