Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
H, W, A, B = map(int, input().split())

total = 0
tmp1, tmp2 = 1, 1		# 初期化
tmp3, tmp4 = 1, 1		# 初期化
for i in range(B,W,1):
  conv1, conv2 = 0, 0	# 初期化
  if i == B:
    for j in range(i):
      tmp1 *= i+(H-A-1)-j
    tmp1 %= (10**9+7)
    for j in range(i, 0, -1):
      tmp2 *= j
    tmp2 %= (10**9+7)
  else:
    tmp1 *= i+(H-A-1)
    tmp1 %= (10**9+7)
    tmp2 *= i
    tmp2 %= (10**9+7)
  conv1 = tmp1/tmp2
  
  if i == B:
    for j in range(W-1-i):
      tmp3 *= (A-1)+(W-1-i)-j
    tmp3 %= (10**9+7)
    for j in range(W-1-i, 0, -1):
      tmp4 *= j
    tmp4 %= (10**9+7)
  else:
    tmp3 *= W-1-i+1
    tmp3 %= (10**9+7)
    tmp4 *= (A-1)+(W-1-i)+1
    tmp4 %= (10**9+7)
  conv2 = tmp3/tmp4
  total += conv1*conv2
print(int(total))

Fixed submission:
A,B,C = map(int, input().split())

if (A == 5 and B == 5 and C == 7) or (A == 5 and B == 7 and C == 5) or (A == 7 and B == 5 and C == 5):
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())

if (A==B&&B!=C) || (A==C&&C!=B) || (C==B&&B!=A):
  print('Yes')
else:
  print('No')

Fixed submission:
A, B, C = map(int, input().split())

if (A==B and B!=C) or (A==C and C!=B) or (C==B and B!=A):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
v = []
for i in range(N):
    s = input()
    if !(s in v):
        v.append(s);

if len(v) == 3:
    print("Three")
else:
    print("Four")

Fixed submission:
N = int(input())
v = []
S = input().split()

for s in S:
    if not s in v:
        v.append(s);

if len(v) == 3:
    print("Three")
else:
    print("Four")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input()

if S[A] == '-' and isdigit(S[0:A]) and isdigit(S[A+1:A+B+1]):
  print("Yes")
else:
  print("No")

Fixed submission:
A, B = map(int, input().split())
S = input()

if S[A] == '-' and S[0:A].isdigit() and S[A+1:A+B+1].isdigit():
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input()

if S[A] == '-' or isdigit(S[0:A]) or isdigit(S[A+1:A+B+1]):
  print("No")
else:
  print("Yes")

Fixed submission:
A, B = map(int, input().split())
S = input()

if S[A] == '-' and S[0:A].isdigit() and S[A+1:A+B+1].isdigit():
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
int ans = 0;
for i in range(1, math.sqrt(N+1)):
  if(i == int(math.sqrt(i))*int(math.sqrt(i))):
    ans = i
    
print(i)

Fixed submission:
import math
N = int(input())
ans = 0
for i in range(1, int(math.sqrt(N))+1):
  if(i == int(math.sqrt(i))*int(math.sqrt(i))):
    ans = i
    
print(i*i)
Buggy python submission (verdict: Runtime Error):
S=input()
s="abcdefghijklnmopqrstuvwxyz"
s = list(s)
  
for si in S:
  if si in s:
  	s.remove(si)
    
if s == "":
  print("None")
else:
  print(s[0])

Fixed submission:
S=input()
s="abcdefghijklnmopqrstuvwxyz"
s = list(s)
  
for si in S:
  if si in s:
  	s.remove(si)
    
if s == []:
  print("None")
else:
  print(s[0])

Buggy python submission (verdict: Runtime Error):
S=input()
s="abcdefghijklmnopqrstucwxyz"

for si in s:
  if si in S
  	S.remove(si)
    
if S == "":
  print("None")
else:
  S.sort()
  print(S[0])

Fixed submission:
S=input()
s="abcdefghijklnmopqrstuvwxyz"
s = list(s)
  
for si in S:
  if si in s:
  	s.remove(si)
    
if s == []:
  print("None")
else:
  print(s[0])
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
ans = 0
for i in range(1, 101)
if A <= i and i <= B amd C <= i and i <= D:
  ans += 1
print(ans)

Fixed submission:
A, B, C, D = map(int, input().split())
ans = 0
for i in range(0, 101):
  if A <= i and i < B and C <= i and i < D:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())

a = A % B

if C % a == 0 or a % C == 0:
  print("YES")
else:
  print("NO")


Fixed submission:
A,B,C = map(int, input().split())

for i in range(0,B):
  if (A*(i+1)) % B == C:
    print("YES")
    exit()

print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
A,B,C = map(int, input().split())
n = A
while n < 100000000:
  if n % B == C:
    print("YES")
    break;
  n += A
if n > 100000000:
  print("NO")

Fixed submission:
A,B,C = map(int, input().split())

for i in range(0,B):
  if (A*(i+1)) % B == C:
    print("YES")
    exit()

print("NO")
Buggy python submission (verdict: Runtime Error):
a,b = input().split()

if a == "H"
    if b == "H":
        print("H")
    else:
        print("D")
else:
    if b == "H":
        print("D")
    else:
        print("H")

Fixed submission:
a,b = input().split()

if a == "H":
    if b == "H":
        print("H")
    else:
        print("D")
else:
    if b == "H":
        print("D")
    else:
        print("H")

Buggy python submission (verdict: Runtime Error):
a,b = input().split()

if a == 'H'
    if b == 'H':
        print('H')
    else:
        print('D')
else:
    if b == 'H':
        print('D')
    else:
        print('H')

Fixed submission:
a,b = input().split()

if a == "H":
    if b == "H":
        print("H")
    else:
        print("D")
else:
    if b == "H":
        print("D")
    else:
        print("H")
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 1
for i in range(1, N+1):
  (ans *= i) %= 1000000007
print(ans)

Fixed submission:
N = int(input())
ans = 1
for i in range(1, N+1):
  ans *= i
  ans %= 1000000007
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
if A==B:
  print("draw")
elif A == 1 or (b != 1 and A>B):
  print("Alice")
else:
  print("Bob")


Fixed submission:
A,B = map(int, input().split())
if A==B:
  print("Draw")
elif A == 1 or (B != 1 and A>B):
  print("Alice")
else:
  print("Bob")

Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
if A==B:
  print("draw")
elif A == 1 or (b != 1 and A>B):
  print("Alice")
else:
  print("Bob");


Fixed submission:
A,B = map(int, input().split())
if A==B:
  print("Draw")
elif A == 1 or (B != 1 and A>B):
  print("Alice")
else:
  print("Bob")
Buggy python submission (verdict: Runtime Error):
def w(p, c):
  return p // c

A,B,X = map(int, input().split())
print(w(B)-w(A-1))

Fixed submission:
def w(p, c):
  return p // c

A,B,X = map(int, input().split())
print(w(B,X)-w(A-1, X))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())

ans = K
for i in range(N-1):
  K *= (k-1)
  
print(ans)

Fixed submission:
N, K = map(int, input().split())

ans = K
for i in range(N-1):
  ans *= (K-1)
  
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, imput().split())
print(max(a*c,a*d,b*d,b*c))

Fixed submission:
a, b, c, d = map(int, input().split())
print(max(a*c,a*d,b*d,b*c))
Buggy python submission (verdict: Runtime Error):
n, x, t = map(int, input())

ans = ((n // x)+int(bool(n%x)))*t

print(ans)

Fixed submission:
n, x, t = map(int, input().split())

ans = ((n // x) + int(bool(n%x)))*t
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input().split())
if n==1:
  print(0)
else:
  print(1)

Fixed submission:
n=int(input())
if n==1:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
n,x,t=map(int,input().split())
u=x
v=t
while(x<n):
  x+=u
  a+=v
print(t)

Fixed submission:
n,x,t=map(int,input().split())
m=t
a=x
while(x<n):
  x+=a
  t+=m
print(t)
Buggy python submission (verdict: Time Limit Exceeded):
def find():
    h,w,m=map(int,input().split())
    idx=[]

    for i in range(m):
      var=list(map(int,input().split()))
      idx.append(var)


    r={}
    c={}
    maze=[[0 for j in range(w)]for i in range(h)]

    for i in idx:
      maze[i[0]-1][i[1]-1]=1
      r.setdefault(i[0]-1,0)
      r[i[0]-1]+=1
      c.setdefault(i[1]-1,0)
      c[i[1]-1]+=1

    ans=0
    maxval=0



    row=[]
    col=[]
    maxr=max(r.values())
    maxc=max(c.values())
    for i in range(h):
      r.setdefault(i,0)
      if r[i]==maxr:
        row.append(i)
      

    for j in range(w):
      c.setdefault(j,0)
      if c[j]==maxc:
        col.append(j)
    
    for i in row:
      for j in col:
        if(maze[i][j]==0):
          return maxc+maxr
         
        
    return maxc+maxr-1
 
print(find())

Fixed submission:
def find():
    h,w,m=map(int,input().split())
    idx=[]


    for i in range(m):
      var=list(map(int,input().split()))
      idx.append(var)


    r={}
    c={}
    #maze=[[0 for j in range(w)]for i in range(h)]
    mz={}

    for i in idx:
      mz.setdefault((i[0]-1,i[1]-1),0)
      mz[(i[0]-1,i[1]-1)]=1
      #maze[i[0]-1][i[1]-1]=1
      r.setdefault(i[0]-1,0)
      r[i[0]-1]+=1
      c.setdefault(i[1]-1,0)
      c[i[1]-1]+=1

    ans=0
    maxval=0



    row=[]
    col=[]
    maxr=max(r.values())
    maxc=max(c.values())
    for i in range(h):
      r.setdefault(i,0)
      if r[i]==maxr:
        row.append(i)
      

    for j in range(w):
      c.setdefault(j,0)
      if c[j]==maxc:
        col.append(j)
    
    for i in row:
      for j in col:
        mz.setdefault((i,j),0)
        if(mz[(i,j)]==0):
          return maxc+maxr
         
    return maxc+maxr-1
 
print(find())
Buggy python submission (verdict: Runtime Error):
a=input()
if a==a.upeer():
  print("A")
else:
  print("a")

Fixed submission:
a=input()
if a==a.upper():
  print("A")
else:
  print("a")
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input(),split)
print(a*b)

Fixed submission:
a,b=map(int,input().split())
print(int(a)*int(b))
Buggy python submission (verdict: Runtime Error):
a=input()
print(a*2*3.1415)

Fixed submission:
import math
a =input()
print(float(a)*2*math.pi)

Buggy python submission (verdict: Runtime Error):
import math
a =input()
print(froat(a)*2*math.py)

Fixed submission:
import math
a =input()
print(float(a)*2*math.pi)
Buggy python submission (verdict: Time Limit Exceeded):
'''
Problem Link - https://atcoder.jp/contests/abc176/tasks/abc176_b
'''
from sys import stdin,stdout
from math import *
from collections import *

mod = 1000000007

def gcd(a,b):
	while b:
		a,b = b,a%b
	return a

def lcm(a,b): return (a*b) // gcd(a,b)

def set_bits(X):
	c = 0
	while X:
		X &= (X-1);c += 1
	return c

def compute_MOD(N,M): return (N%M + M) % M

def get_array(): return list(map(int, stdin.readline().split()))
 
def get_ints(): return map(int, stdin.readline().split())

def get_int(): return int(stdin.readline())

def get_input(): return stdin.readline().strip()

def main():
	N = get_int()
	Sum = 0
	while N>0:
		rem = N%10
		Sum += rem*10
		N //= 10
	if Sum%9==0:stdout.write('Yes\n')
	else:stdout.write('No\n')

if __name__ == "__main__":
    main()

Fixed submission:
'''
Problem Link - https://atcoder.jp/contests/abc176/tasks/abc176_b
'''
from sys import stdin,stdout
from math import *
from collections import *

mod = 1000000007

def gcd(a,b):
	while b:
		a,b = b,a%b
	return a

def lcm(a,b): return (a*b) // gcd(a,b)

def set_bits(X):
	c = 0
	while X:
		X &= (X-1);c += 1
	return c

def compute_MOD(N,M): return (N%M + M) % M

def get_array(): return list(map(int, stdin.readline().split()))
 
def get_ints(): return map(int, stdin.readline().split())

def get_int(): return int(stdin.readline())

def get_input(): return stdin.readline().strip()

def main():
	N = get_input()
	Sum = 0
	for i in N:Sum+=int(i)
	if Sum%9==0:stdout.write('Yes\n')
	else:stdout.write('No\n')
	

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
array = list(map(int, input().split()))
if (array[0] > array[1]):
  tmp = array[0]
  arrat[0] = array[1]
  array[1] = tmp

if (array[1] > array[2]):
  tmp = array[1]
  arrat[1] = array[2]
  array[2] = tmp

if (array[0] > array[2]):
  tmp = array[0]
  arrat[0] = array[2]
  array[2] = tmp

print("%d %d %d" %(array[0], array[1], array[2]))

  

Fixed submission:
array = list(map(int, input().split()))

tmp = array[0]
array[0] = array[1]
array[1] = tmp

tmp = array[0]
array[0] = array[2]
array[2] = tmp


print("%d %d %d" %(array[0], array[1], array[2]))
Buggy python submission (verdict: Runtime Error):
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
soutoku = 0
for num in array:
  soutoku += num
tokuhyousuu = soutokuku / (4 * float(array[1]))
ninnkiCounter = 0
for num in array:
  if (float(num) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

Fixed submission:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
soutoku = 0
for num in array:
  soutoku += num
tokuhyousuu = soutoku / (4 * float(arrayNM[1]))
ninnkiCounter = 0
for num in array:
  if (float(num) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
arrayNM = list(map(int, input.split()))
array = list(map(int, input.split()))
tokuhyousuu = 1 / (4 * array[1])
ninnkiCounter = 0
for num in array:
  if ((float)num >= tokuhyosuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")

Fixed submission:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
soutoku = 0
for num in array:
  soutoku += num
tokuhyousuu = soutoku / (4 * float(arrayNM[1]))
ninnkiCounter = 0
for num in array:
  if (float(num) >= tokuhyousuu):
    ninnkiCounter += 1
    

if (arrayNM[1] <= ninnkiCounter):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
array = list(map(int, input().split()))
tmp = array[0]
array[0] = abs(array[0] - array[1])
while (tmp >= array[0]):
  tmp = array[0]
  array[0] = abs(array[0] - array[1])
print(tmp)


Fixed submission:
array = list(map(int, input().split()))
tmp = array[0] % array[1]
if (tmp <= array[1] / 2):
  print(tmp)
else:
  print(abs(tmp-array[1]))

Buggy python submission (verdict: Time Limit Exceeded):
array = list(map(int, input().split()))
tmp = array[0]
array[0] = abs(array[0] - array[1])
while (tmp >= array[0]):
  tmp = array[0]
  array[0] = abs(array[0] - array[1])
print(tmp)


Fixed submission:
array = list(map(int, input().split()))
tmp = array[0] % array[1]
if (tmp <= array[1] / 2):
  print(tmp)
else:
  print(abs(tmp-array[1]))
Buggy python submission (verdict: Runtime Error):
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex + 1, array[1]):
  distance += route[i]

print(distance)



Fixed submission:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex + 1, arrayNM[1]):
  distance += route[i]

print(distance)

Buggy python submission (verdict: Runtime Error):
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex + 1, array[1]):
  distance += route[i]

print(distance)
print(route)



Fixed submission:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex + 1, arrayNM[1]):
  distance += route[i]

print(distance)

Buggy python submission (verdict: Runtime Error):
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex, array[0]):
  distance += route[i]

print(distance)
print(route)



Fixed submission:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex + 1, arrayNM[1]):
  distance += route[i]

print(distance)
Buggy python submission (verdict: Runtime Error):
integer = int(input().split())
conbi = (integer[0] * (integer[0] - 1) + integer[1] * (integer[1] -1 )) / 2
print(conbi)

Fixed submission:
integer = list(map(int, input().split())) 
conbi = (integer[0] * (integer[0] - 1) + integer[1] * (integer[1] -1 ) ) / 2
print(int(conbi))

Buggy python submission (verdict: Runtime Error):
integer = int(input().split())
conbi = ((integer[0] * (integer[0] - 1) + integer[1] * (integer[1] -1 )) / 2
print(conbi)

Fixed submission:
integer = list(map(int, input().split())) 
conbi = (integer[0] * (integer[0] - 1) + integer[1] * (integer[1] -1 ) ) / 2
print(int(conbi))
Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)
num = int((n-1)/2)-1
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()
    
num = int(num /2 -1)
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()

num = len(s) * 0.5 - 1.5
index = int((n + 3) /2 )
for i in range(num):
  if s[index+i] != s[n-1-i]:
    print("No")
    exit()
   
  
print("Yes")

    

    

Fixed submission:
s = input()
n = len(s)
num = int((n-1)/2)-1
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()
    
num = int(num /2 -1)
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()

num = int(len(s) * 0.5 - 1.5)
index = int((n + 3) /2 -1 )
for i in range(num):
  if s[index+i] != s[n-1-i]:
    print("No")
    exit()
   
  
print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import copy
n = int(input())
integer = list(map(int, input().split()))
length = len(integer)
count = 0
for i in range(length):
  tmp = copy.copy(integer)
  del(tmp[i])
  for j in range(length-2):
    for k in range(j+1, length-1):
      if tmp[j] == tmp[k]:
        count += 1      
  print(count)
  count = 0

Fixed submission:
from collections import Counter

n = int(input())
integer = list(map(int, input().split()))
length = len(integer)
counter = Counter(integer)
keys = counter.keys()
total = 0
for key in keys:
  total += counter[key] * ( counter[key] -1 ) / 2
total = int(total)

for i in integer:
  tmp = total
  tmp -= counter[i] - 1
  print(tmp)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
n = int(input())
integer = list(map(int, input().split()))
length = len(integer)
tmp = []
count = 0
for i in range(length):
  tmp = copy.copy(integer)
  del(tmp[i])
  for j in range(length-2):
    for k in range(j+1, length-1):
      if tmp[j] == tmp[k]:
        count += 1      
  print(count)
  count = 0

Fixed submission:
from collections import Counter

n = int(input())
integer = list(map(int, input().split()))
length = len(integer)
counter = Counter(integer)
keys = counter.keys()
total = 0
for key in keys:
  total += counter[key] * ( counter[key] -1 ) / 2
total = int(total)

for i in integer:
  tmp = total
  tmp -= counter[i] - 1
  print(tmp)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import copy
n = int(input())
integer = list(map(int, input().split()))
length = len(integer)
tmp = []
count = 0
for i in range(length):
  tmp = copy.copy(integer)
  del(tmp[i])
  for j in range(length-2):
    for k in range(j+1, length-1):
      if tmp[j] == tmp[k]:
        count += 1      
  print(count)
  count = 0

Fixed submission:
from collections import Counter

n = int(input())
integer = list(map(int, input().split()))
length = len(integer)
counter = Counter(integer)
keys = counter.keys()
total = 0
for key in keys:
  total += counter[key] * ( counter[key] -1 ) / 2
total = int(total)

for i in integer:
  tmp = total
  tmp -= counter[i] - 1
  print(tmp)
Buggy python submission (verdict: Runtime Error):
import numpy
n = numpy.int64(n)
m = numpy.int64(m)
n = n % m
print(min(n, m-n))


Fixed submission:
import numpy

n, m = input().split()
n = numpy.int64(n)
m = numpy.int64(m)
n = n % m
print(min(n, m-n))

Buggy python submission (verdict: Runtime Error):
import numpy

n = numpy.int64(n)
m = numpy.int64(m)
n = n % m
print(min(n, m-n))


Fixed submission:
import numpy

n, m = input().split()
n = numpy.int64(n)
m = numpy.int64(m)
n = n % m
print(min(n, m-n))
Buggy python submission (verdict: Runtime Error):
princt(int(input()) ^ 1)

Fixed submission:
print(int(input()) ^ 1)
Buggy python submission (verdict: Runtime Error):
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(input())


def MI(): return map(int,input().split())


def MF(): return map(float,input().split())


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')
import numpy as np

def main():
	n=II()
	A=np.array([0]+LI()+[10**6])
	B=np.array([0]+LI()+[10**6])
	Ar=(A[:-1]<A[1:])[1:]
	Al=(A[:-1]<A[1:])[:-1]
	Br=(B[:-1]<B[1:])[1:]
	Bl=(B[:-1]<B[1:])[:-1]
	
	A=A[1:-1]
	B=B[1:-1]
	
	#print(Ar*A)
	
	AAl=np.array([10**7]*(n+1))
	AAr=np.array([10**7]*(n+1))
	BBl=np.array([-10**7]*(n+1))
	BBr=np.array([-10**7]*(n+1))
	
	for i in range(n):
		if Al[i]==1:
			AAl[A[i]]=i
		if Ar[i]==1:
			AAr[A[i]]=i
		if Bl[i]==1:
			BBl[B[i]]=i
		if Br[i]==1:
			BBr[B[i]]=i
	
	L=AAl-BBr
	R=AAr-BBl
	R=R[R<10**6]
	#print(L)
	LL=L.min()
	RR=max(R)
	#print(LL)
	#print(RR)
	
	if RR-LL+2>n:
		print("No")
	else:
		print("Yes")
		C=np.concatenate([B[RR+1:],B[:RR+1]])
		print(*C)
	
	


	









if __name__=="__main__":
	main()


Fixed submission:
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(input())


def MI(): return map(int,input().split())


def MF(): return map(float,input().split())


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')
import numpy as np

def main():
	n=II()
	A=np.array([0]+LI()+[10**6])
	B=np.array([0]+LI()+[10**6])
	Ar=(A[:-1]<A[1:])[1:]
	Al=(A[:-1]<A[1:])[:-1]
	Br=(B[:-1]<B[1:])[1:]
	Bl=(B[:-1]<B[1:])[:-1]
	
	A=A[1:-1]
	B=B[1:-1]
	
	#print(Al,Ar,Bl,Br)
	
	AAl=np.array([10**7]*(n+1))
	AAr=np.array([10**7]*(n+1))
	BBl=np.array([-10**7]*(n+1))
	BBr=np.array([-10**7]*(n+1))
	
	for i in range(n):
		if Al[i]==1:
			AAl[A[i]]=i
		if Ar[i]==1:
			AAr[A[i]]=i
		if Bl[i]==1:
			BBl[B[i]]=i
		if Br[i]==1:
			BBr[B[i]]=i
	
	L=AAl-BBr
	R=AAr-BBl
	R=R[R<10**6]
	#print(L)
	LL=L.min()
	
	try:
		RR=max(R)
	except:
		RR=0
	#print(LL)
	#print(RR)
	
	if RR-LL+2>n:
		print("No")
	else:
		print("Yes")
		C=np.concatenate([B[-LL+1:],B[:-LL+1]])
		print(*C)
	
	


	









if __name__=="__main__":
	main()