output_description: Print the minimum possible absolute value of the coordinate of the
  destination.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      X K D
attempt: X, K, D = [int(n) for n in input().split(" ")]
  
  # X = 10
  # K = 1
  # D = 2
  
  
  startN = (D * K - X) // (2 * D)
  
  N1 = startN + 1
  N2 = startN
  N3 = startN - 1
  
  if N1 < 0:
      N1 = 0
  if N2 < 0:
      N2 = 0
  if N3 < 0:
      N3 = 0
  
  
  def getScore(n):
      score = X + n * D - D * (K - n)
      if score < 0:
          score = score * -1
      return score
  
  
  score1 = getScore(N1)
  score2 = getScore(N2)
  score3 = getScore(N3)
  
  minScore = score1
  if minScore > score2:
      minScore = score2
  if minScore > score3:
      minScore = score3
  
  print(minScore)
  
problem_description: Statement
  
  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.
samples: [{"input": "6 2 4", "output": "2\n    \n\nTakahashi is now at coordinate 6. It is optimal to make the following moves:\n\n  * Move from coordinate 6 to (6 - 4 =) 2.\n  * Move from coordinate 2 to (2 - 4 =) -2.\n\nHere, the absolute value of the coordinate of the destination is 2, and we\ncannot make it smaller.\n\n* * *"}, {"input": "7 4 3", "output": "1\n    \n\nTakahashi is now at coordinate 7. It is optimal to make, for example, the\nfollowing moves:\n\n  * Move from coordinate 7 to 4.\n  * Move from coordinate 4 to 7.\n  * Move from coordinate 7 to 4.\n  * Move from coordinate 4 to 1.\n\nHere, the absolute value of the coordinate of the destination is 1, and we\ncannot make it smaller.\n\n* * *"}, {"input": "10 1 2", "output": "8\n    \n\n* * *"}, {"input": "1000000000000000 1000000000000000 1000000000000000", "output": "1000000000000000\n    \n\nThe answer can be enormous."}]