x, k, d = map(int, input().split())
if x < 0:
    target = abs(x) // d
    x = x + d * min(target, k)
    k -= min(target, k)
else:
    target = x // d
    x = x - d * min(target, k)
    k -= min(target, k)
if k % 2 != 0:
    if x < 0:
        x += d
    else:
        x -= d
print(abs(x)) x, k, d = map(int, input().split()) x map(int, input().split()) map int input().split() ().split () input split k d if x < 0:
    target = abs(x) // d
    x = x + d * min(target, k)
    k -= min(target, k)
else:
    target = x // d
    x = x - d * min(target, k)
    k -= min(target, k) x < 0 x 0 target = abs(x) // d target abs(x) // d abs(x) abs x d x = x + d * min(target, k) x x + d * min(target, k) x d * min(target, k) d min(target, k) min target k k -= min(target, k) k min(target, k) min target k target = x // d target x // d x d x = x - d * min(target, k) x x - d * min(target, k) x d * min(target, k) d min(target, k) min target k k -= min(target, k) k min(target, k) min target k if k % 2 != 0:
    if x < 0:
        x += d
    else:
        x -= d k % 2 != 0 k % 2 k 2 0 if x < 0:
        x += d
    else:
        x -= d x < 0 x 0 x += d x d x -= d x d print(abs(x)) print abs(x) abs x d = map(int, input().split()) map(int, input().split()) d k -= min(target, k) min(target, k) k x = x + d * min(target, k) x + d * min(target, k) x x = x - d * min(target, k) x - d * min(target, k) x k, d = map(int, input().split()) map(int, input().split()) k target = x // d x // d target k -= min(target, k) min(target, k) k x, k, d = map(int, input().split()) map(int, input().split()) x target = abs(x) // d abs(x) // d target x -= d d x x += d d x
x, k, d = map(int, input().split())
if x < 0:
    target = abs(x) // d
    x = x + d * min(target, k)
    k -= min(target, k)
else:
    target = x // d
    x = x - d * min(target, k)
    k -= min(target, k)
if k % 2 != 0:
    if x < 0:
        x += d
    else:
        x -= d
print(abs(x))
