Buggy python submission (verdict: Time Limit Exceeded):
param_x, param_k, param_d = map(int, input().split())

param_x_tmp = param_x

if param_x > 0:
  int_times_nega_posi = -1
else:
  int_times_nega_posi =  1
  
if (param_x*int_times_nega_posi*-1) - (param_k*param_d) > 0:
  print((param_x*int_times_nega_posi*-1) - (param_k*param_d))
  
else:
  count = 0
  while param_x_tmp*param_x > 0:
    
    param_x_tmp = param_x_tmp + param_d*int_times_nega_posi
    
    count = count + 1
    
    if param_k - count == 0:
      print(abs(param_x_tmp))
  
  if count < param_k:
    int_move = param_k - count #move left
    int_move_devide_2_no_amari = int_move % 2
    print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi*-1))

Fixed submission:
param_x, param_k, param_d = map(int, input().split())

param_x_tmp = param_x

if param_x > 0:
  int_times_nega_posi = -1
else:
  int_times_nega_posi =  1
  
if (param_x*int_times_nega_posi*-1) - (param_k*param_d) > 0:
  print((param_x*int_times_nega_posi*-1) - (param_k*param_d))
  
else:
  int_time_before_cross_0 = int((param_x*int_times_nega_posi*-1) / param_d)
  # print(int_time_before_cross_0)
  
  param_x_tmp = param_x + int_time_before_cross_0*param_d*int_times_nega_posi
  # print(param_x_tmp)
  
  int_move = param_k - int_time_before_cross_0 #move left
  int_move_devide_2_no_amari = int_move % 2
  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi))
  
  #count = 0
  #while param_x_tmp*param_x > 0:
  #  
  #  param_x_tmp = param_x_tmp + param_d*int_times_nega_posi
  #  
  #  count = count + 1
  #  
  #  if param_k - count == 0:
  #    print(abs(param_x_tmp))
  #
  #if count < param_k:
  #  int_move = param_k - count #move left
  #  int_move_devide_2_no_amari = int_move % 2
  #  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi*-1))

Buggy python submission (verdict: Time Limit Exceeded):
param_x, param_k, param_d = map(int, input().split())

param_x_tmp = param_x

if param_x > 0:
  int_times_nega_posi = -1
else:
  int_times_nega_posi =  1

count = 0
while param_x_tmp*param_x > 0:
  
  param_x_tmp = param_x_tmp + param_d*int_times_nega_posi
  
  count = count + 1
  
  if param_k - count == 0:
    print(abs(param_x_tmp))

if count < param_k:
  int_move = param_k - count #move left
  int_move_devide_2_no_amari = int_move % 2
  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi*-1))

Fixed submission:
param_x, param_k, param_d = map(int, input().split())

param_x_tmp = param_x

if param_x > 0:
  int_times_nega_posi = -1
else:
  int_times_nega_posi =  1
  
if (param_x*int_times_nega_posi*-1) - (param_k*param_d) > 0:
  print((param_x*int_times_nega_posi*-1) - (param_k*param_d))
  
else:
  int_time_before_cross_0 = int((param_x*int_times_nega_posi*-1) / param_d)
  # print(int_time_before_cross_0)
  
  param_x_tmp = param_x + int_time_before_cross_0*param_d*int_times_nega_posi
  # print(param_x_tmp)
  
  int_move = param_k - int_time_before_cross_0 #move left
  int_move_devide_2_no_amari = int_move % 2
  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi))
  
  #count = 0
  #while param_x_tmp*param_x > 0:
  #  
  #  param_x_tmp = param_x_tmp + param_d*int_times_nega_posi
  #  
  #  count = count + 1
  #  
  #  if param_k - count == 0:
  #    print(abs(param_x_tmp))
  #
  #if count < param_k:
  #  int_move = param_k - count #move left
  #  int_move_devide_2_no_amari = int_move % 2
  #  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi*-1))

Buggy python submission (verdict: Time Limit Exceeded):
param_x, param_k, param_d = map(int, input().split())

param_x_tmp = param_x

if param_x > 0:
  int_times_nega_posi = -1
else:
  int_times_nega_posi =  1

count = 0
while param_x_tmp*param_x > 0:
  
  param_x_tmp = param_x_tmp + param_d*int_times_nega_posi
  
  count = count + 1
  
  if count == param_k:
    print(abs(param_x_tmp))

if count < param_k:
  int_move = param_k - count #move left
  int_move_devide_2_no_amari = int_move % 2
  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi*-1))

Fixed submission:
param_x, param_k, param_d = map(int, input().split())

param_x_tmp = param_x

if param_x > 0:
  int_times_nega_posi = -1
else:
  int_times_nega_posi =  1
  
if (param_x*int_times_nega_posi*-1) - (param_k*param_d) > 0:
  print((param_x*int_times_nega_posi*-1) - (param_k*param_d))
  
else:
  int_time_before_cross_0 = int((param_x*int_times_nega_posi*-1) / param_d)
  # print(int_time_before_cross_0)
  
  param_x_tmp = param_x + int_time_before_cross_0*param_d*int_times_nega_posi
  # print(param_x_tmp)
  
  int_move = param_k - int_time_before_cross_0 #move left
  int_move_devide_2_no_amari = int_move % 2
  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi))
  
  #count = 0
  #while param_x_tmp*param_x > 0:
  #  
  #  param_x_tmp = param_x_tmp + param_d*int_times_nega_posi
  #  
  #  count = count + 1
  #  
  #  if param_k - count == 0:
  #    print(abs(param_x_tmp))
  #
  #if count < param_k:
  #  int_move = param_k - count #move left
  #  int_move_devide_2_no_amari = int_move % 2
  #  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi*-1))

Buggy python submission (verdict: Time Limit Exceeded):
param_x, param_k, param_d = map(int, input().split())

# print(param_x, param_k, param_d)

param_x_tmp = param_x

if param_x > 0:
  int_times_nega_posi = -1
else:
  int_times_nega_posi =  1

# before cross 0
count = 0
while param_x_tmp*param_x > 0:
  
  param_x_tmp = param_x_tmp + param_d*int_times_nega_posi
  
  count = count + 1
  
  # 
  #print(count, param_x_tmp)
  
  if count == param_k:
    print(abs(param_x_tmp))

# after cross 0
if count < param_k:
  int_move = param_k - count #move left
  int_move_devide_2_no_amari = int_move % 2
  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi*-1))

Fixed submission:
param_x, param_k, param_d = map(int, input().split())

param_x_tmp = param_x

if param_x > 0:
  int_times_nega_posi = -1
else:
  int_times_nega_posi =  1
  
if (param_x*int_times_nega_posi*-1) - (param_k*param_d) > 0:
  print((param_x*int_times_nega_posi*-1) - (param_k*param_d))
  
else:
  int_time_before_cross_0 = int((param_x*int_times_nega_posi*-1) / param_d)
  # print(int_time_before_cross_0)
  
  param_x_tmp = param_x + int_time_before_cross_0*param_d*int_times_nega_posi
  # print(param_x_tmp)
  
  int_move = param_k - int_time_before_cross_0 #move left
  int_move_devide_2_no_amari = int_move % 2
  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi))
  
  #count = 0
  #while param_x_tmp*param_x > 0:
  #  
  #  param_x_tmp = param_x_tmp + param_d*int_times_nega_posi
  #  
  #  count = count + 1
  #  
  #  if param_k - count == 0:
  #    print(abs(param_x_tmp))
  #
  #if count < param_k:
  #  int_move = param_k - count #move left
  #  int_move_devide_2_no_amari = int_move % 2
  #  print(abs(param_x_tmp + param_d*int_move_devide_2_no_amari*int_times_nega_posi*-1))