Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
tmp = N

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Buggy python submission (verdict: Time Limit Exceeded):
import math

N,K = map(int,input().split())
tmp = N

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
int tmp = 0


while:
	tmp = N
	if(abs(tmp - K) < tmp):
      	tmp = abs(tmp - K)
   	else:
      	break
 	
print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
int tmp = 0
 
while:
	tmp = N
	if(abs(tmp - K) < tmp):
      	tmp = abs(tmp - K)
   	else:
      	break
 	
print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
int tmp = 0
 
while:
	tmp = N
	if(abs(tmp - K) < tmp):
      	tmp = abs(tmp - K)
   	else:
      	break
 	
print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
int tmp = 0
 
while:
	tmp = N
	if(abs(tmp - K) < tmp):
      	tmp = abs(tmp - K)
   	else:
      	break
 	
print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
int tmp = 0
 
while();
	tmp = N
	if(abs(tmp - K) < tmp);
      	tmp = abs(tmp - K)
   	else;
      	break
 	
print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
int tmp = 0
 
while();
  N = tmp
  	if(abs(tmp - K) < tmp);
      tmp = abs(tmp - K)
  	else;
      break

    
print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
int tmp = 0

while(){
  N = tmp
  	if(abs(tmp - K) < tmp){
      tmp = abs(tmp - K)
    }
  	else{
      break;
    }
}

print(tmp)

Fixed submission:
import math

N,K = map(int,input().split())
tmp = N%K

while True:
  if abs(tmp - K) < tmp:
    tmp = abs(tmp - K)
  else:
    break
 	
print(tmp)