a,c,b = list(map(int, input().split()))

a = abs(a)
b = abs(b)
c = abs(c)

if b*c <= a:
  print(a - (b*c))
else:
  c -= a//b
  a = a%b
  #print(a,b,c)
  if c%2==0:
    print(a)
  else:
    print(abs(a-b)) a,c,b = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split c b a = abs(a) a abs(a) abs a b = abs(b) b abs(b) abs b c = abs(c) c abs(c) abs c if b*c <= a:
  print(a - (b*c))
else:
  c -= a//b
  a = a%b
  #print(a,b,c)
  if c%2==0:
    print(a)
  else:
    print(abs(a-b)) b*c <= a b*c b c a print(a - (b*c)) print a - (b*c) a b*c b c c -= a//b c a//b a b a = a%b a a%b a b if c%2==0:
    print(a)
  else:
    print(abs(a-b)) c%2==0 c%2 c 2 0 print(a) print a print(abs(a-b)) print abs(a-b) abs a-b a b b = list(map(int, input().split())) list(map(int, input().split())) b b = abs(b) abs(b) b a,c,b = list(map(int, input().split())) list(map(int, input().split())) a a = a%b a%b a c,b = list(map(int, input().split())) list(map(int, input().split())) c a = abs(a) abs(a) a c = abs(c) abs(c) c c -= a//b a//b c
a,c,b = list(map(int, input().split()))

a = abs(a)
b = abs(b)
c = abs(c)

if b*c <= a:
  print(a - (b*c))
else:
  c -= a//b
  a = a%b
  #print(a,b,c)
  if c%2==0:
    print(a)
  else:
    print(abs(a-b))