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, D, C = map(int, input().split())
  count = abs(X)
  a = X // C
  b = X % C
  if a > D:
      print(count - D * C)
  elif a == D:
      print(b)
  elif a < D:
      D = D - a
      if D % 2 == 0:
          print(b)
      else:
          print(min(abs(b - C), abs(b + C)))
  
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."}]