Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.

More specifically, in one move, he can go from coordinate x to x + D or x - D.

He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.

Find the minimum possible absolute value of the coordinate of the destination.

Constraints

* -10^{15} \leq X \leq 10^{15}
* 1 \leq K \leq 10^{15}
* 1 \leq D \leq 10^{15}
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


X K D


Output

Print the minimum possible absolute value of the coordinate of the destination.

Examples

Input

6 2 4


Output

2


Input

7 4 3


Output

1


Input

10 1 2


Output

8


Input

1000000000000000 1000000000000000 1000000000000000


Output

1000000000000000
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	void solve(Supplier<String> sc) {
		long X = Long.parseLong(sc.get());
		long K = Long.parseLong(sc.get());
		long D = Long.parseLong(sc.get());
		var floor = Math.floorDiv(X, D);
		var ceil = -Math.floorDiv(-X, D);
		if (Math.abs(floor) > K) {
			System.out.println(Math.abs(X - (floor < 0 ? -1 : 1) * K * D));
			return;
		}
		var floorDistance = Math.abs(X - floor * D);
		var ceilDistance = Math.abs(X - ceil * D);
		if (Math.abs(ceil) > K) {
			System.out.println(floorDistance);
		} else if ((K - floor) % 2 == 0) {
			System.out.println(floorDistance);
		} else if ((K - ceil) % 2 == 0) {
			System.out.println(ceilDistance);
		} else {
			System.out.println(D + Math.min(floorDistance, ceilDistance));
		}
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		new Solver().solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}