public static void main(String[] args) {
		InputReader inputReader = new InputReader(System.in);
		int n = inputReader.nextInt();
		int k = inputReader.nextInt();
		int[] numbers = inputReader.nextIntArray(n);
		// Arrays.sort(numbers);

		int index = 0;

		while (k > 0 && index < n && numbers[index] < 0) {
			numbers[index] = -numbers[index];
			sum += (numbers[index] * 2);
			k--;
			index++;
		}

		while (k >= 2) {
			k -= 2;
		}

		if (k > 0) {
			if (index >= n) {
				index--;
			} else if (0 < index && index < n
					&& numbers[index] > numbers[index - 1]) {
				index--;
			}

				numbers[index] = -numbers[index];
			sum += (numbers[index] * 2);
		}

		System.out.println(sum);
	}