Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

summa=0
if N>1:
  summa+=math.factorial(N)/(math.factorial(2)*math.factorial(N-2))
if M>1:
  summa+=math.factorial(M)/(math.factorial(2)*math.factorial(M-2))
  
print(summa)

Fixed submission:
import math

N, M = map(int, input().split())
     
summa=0
if N>1:
   summa+=math.factorial(N)/(math.factorial(2)*math.factorial(N-2))
if M>1:
   summa+=math.factorial(M)/(math.factorial(2)*math.factorial(M-2))
      
print(int(summa))
Buggy python submission (verdict: Runtime Error):
x, y, z = map(int, input().split())
print(f"{z} {x} {y}")

Fixed submission:
x, y, z = map(int, input().split())
print('{} {} {}'.format(z, x, y))

Buggy python submission (verdict: Runtime Error):
k = int(input())
lunlun = [0] * 100
lunlun[1] = [1, 2, 3, 4, 5, 6, 7, 8, 9]
i = 1

for i in range(9):
    n = len(lunlun[i])
    lunlun[i+1] = []
    for x in lunlun[i]:
        r = x%10
        if r > 0:
            lunlun[i+1].append(10*x + r-1)
        lunlun[i+1].append(10*x + r)
        if r < 9:
            lunlun[i+1].append(10*x + r+1)
    i += 1

for i in range(1, 11):
    for j in range(len(lunlun[i])):
        k -= 1
        if k == 0:
            print(lunlun[i][j])
            exit()


Fixed submission:
X, Y, Z = map(int, input().split())
print(str(Z) + " " + str(X) + " " + str(Y))

Buggy python submission (verdict: Runtime Error):
a = int(input())

N = [1,2,3,4,56,7,8,9]

for x in range(a):
  tmp = N[x]
  if tmp%10 != 0:
    N.append(tmp*10+tmp%10-1)
  N.append(tmp*10+tmp%10)
  if tmp%10 != 9:
    N.append(tmp*10+tmp%10+1)
print(N[a-1])
    
  
  

Fixed submission:
X, Y, Z = map(int, input().split())
print(str(Z) + " " + str(X) + " " + str(Y))
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
ans1 = N % K
ans2 = abs(ans1 - K )
print(min(ans1,ans2)

Fixed submission:
N,K = map(int,input().split())
ans1 = N % K
ans2 = abs(ans1-K)
print(min(ans1,ans2))

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
ans1 = N - K
ans2 = abs(ans1 - K)
print(min(ans1,ans2)

Fixed submission:
N,K = map(int,input().split())
ans1 = N % K
ans2 = abs(ans1-K)
print(min(ans1,ans2))
Buggy python submission (verdict: Runtime Error):
k = int(input())
lunlun = [0] * 100
lunlun[1] = [1, 2, 3, 4, 5, 6, 7, 8, 9]
i = 1

for i in range(9):
    n = len(lunlun[i])
    lunlun[i+1] = []
    for x in lunlun[i]:
        r = x%10
        if r > 0:
            lunlun[i+1].append(10*x + r-1)
        lunlun[i+1].append(10*x + r)
        if r < 9:
            lunlun[i+1].append(10*x + r+1)
    i += 1

for i in range(1, 11):
    for j in range(len(lunlun[i])):
        k -= 1
        if k == 0:
            print(lunlun[i][j])
            exit()


Fixed submission:
k = int(input())
lunlun = [0] * 100
lunlun[1] = [1, 2, 3, 4, 5, 6, 7, 8, 9]
i = 1

for _ in range(9):
    n = len(lunlun[i])
    lunlun[i+1] = []
    for x in lunlun[i]:
        r = x%10
        if r > 0:
            lunlun[i+1].append(10*x + r-1)
        lunlun[i+1].append(10*x + r)
        if r < 9:
            lunlun[i+1].append(10*x + r+1)
    i += 1

for i in range(1, 11):
    for j in range(len(lunlun[i])):
        k -= 1
        if k == 0:
            print(lunlun[i][j])
            exit()

Buggy python submission (verdict: Runtime Error):
a = int(input())

N = [1,2,3,4,5,6,7,8,9]

For  x  in  range(a):
  tmp = N[x]
  if tmp%10 != 0:
    N.append(tmp*10+tmp%10-1)
  N.append(tmp*10+tmp%10)
  if tmp%10 != 9:
    N.append(tmp*10+tmp%10+1)
print(N[a-1])


Fixed submission:
k = int(input())
lunlun = [0] * 100
lunlun[1] = [1, 2, 3, 4, 5, 6, 7, 8, 9]
i = 1

for _ in range(9):
    n = len(lunlun[i])
    lunlun[i+1] = []
    for x in lunlun[i]:
        r = x%10
        if r > 0:
            lunlun[i+1].append(10*x + r-1)
        lunlun[i+1].append(10*x + r)
        if r < 9:
            lunlun[i+1].append(10*x + r+1)
    i += 1

for i in range(1, 11):
    for j in range(len(lunlun[i])):
        k -= 1
        if k == 0:
            print(lunlun[i][j])
            exit()
Buggy python submission (verdict: Runtime Error):
S = input().split("/")
if S[1]==4 and S[2]<=30:
    print("Heisei")
elif S>4:
    print("TBD")
else:
    print("Heisei")


Fixed submission:
S = input().split("/")
if int(S[1])==4 and int(S[2])<=30:
    print("Heisei")
elif int(S[1])>4:
    print("TBD")
else:
    print("Heisei")
Buggy python submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
Xs = sorted(list(map(int,input().split())))
ranges = sorted([abs(Xs[i]-Xs[i-1]) for i in range(1,len(Xs))],reverse=True)
ans = Xs[M-1]-Xs[0]
for n in range(N-1):
    ans-=ranges[n]
print(ans)

Fixed submission:
import sys
N,M = map(int,input().split())
if N>M:
    print(0)
    sys.exit()
Xs = sorted(list(map(int,input().split())))
ranges = sorted([abs(Xs[i]-Xs[i-1]) for i in range(1,len(Xs))],reverse=True)
ans = Xs[M-1]-Xs[0]
for n in range(N-1):
    ans-=ranges[n]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,a=[int(_) for _ in input().split()]
x=[int(_) for _ in input().split()]
dp=[[[0 for k in range(2551)] for j in range(51)] for i in range(n)]
dp[0][1][x[0]]=1;dp[0][0][0]=1
for i in range(n-1):
    for j in range(50):
        for k in range(2501):
            dp[i+1][j+1][k+x[i+1]] += dp[i][j][k]
            dp[i+1][j][k] += dp[i][j][k]
ans=0
for j in range(1,n+1):ans += dp[-1][j][j*a]
print(ans)

Fixed submission:
n,a=[int(_) for _ in input().split()]
x=[int(_) for _ in input().split()]
dp=[[[0 for k in range(2551)] for j in range(51)] for i in range(n)]
dp[0][1][x[0]]=1;dp[0][0][0]=1
for i in range(n-1):
    for j in range(50):
        for k in range(2501):
            dp[i+1][j+1][k+x[i+1]] += dp[i][j][k]
            dp[i+1][j][k] += dp[i][j][k]
ans=0
for j in range(1,n+1):ans += dp[-1][j][j*a]
print(ans)
Buggy python submission (verdict: Runtime Error):
S,T = input().split()
A,B = map(int,input().split())
U = input()

if S == U :
    print(f"{A-1} {B}")
else :
    print(f"{A} {B-1}")

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

if S == U :
    print("{} {}".format(A-1,B))
else :
    print("{} {}".format(A,B-1))

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

if S == U :
    print(f"{A-1} {B}")
else :
    print(f"{A} {B-1}")

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

if S == U :
    print("{} {}".format(A-1,B))
else :
    print("{} {}".format(A,B-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

cnt = 0
for i in range(1000):
    
    t = str(i)
    u = '0'*(3-len(t))+t
    
    j = 0
    p = u[0]
    for x in s:
        if x == p:
            j += 1
            if j == 3:
                cnt += 1
                break
            p = u[j]
            
print(ans)

Fixed submission:
n=int(input())
s=input()
list=["" for _ in range(1000)]
ans=0
for i in range(1000):
  t=str(i)
  u="0"*(3-len(t))+t
  j=0
  exi=0
  p=u[0]
  for x in s:
    if x==p:
      j+=1
      if j==3:
        ans+=1
        break
      p=u[j]
    
print(ans)
Buggy python submission (verdict: Runtime Error):
s =input()
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    if i in ACGT:
        cnt += 1
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

Fixed submission:
s =input()
s += ' '
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    if i in ACGT:
        cnt += 1
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

Buggy python submission (verdict: Runtime Error):
# ABC122_B
s = input()
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    for k in ACGT:
        if i == k:
            cnt += 1
            continue
    if all([i != k for k in ACGT]):
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

Fixed submission:
s =input()
s += ' '
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    if i in ACGT:
        cnt += 1
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

Buggy python submission (verdict: Runtime Error):
# ABC122_B
s = input()
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    for k in ACGT:
        if i == k:
            cnt += 1
        if all([i != k for k in ACGT]):
            cnt_list.append(cnt)
            cnt = 0
print(max(cnt_list))

Fixed submission:
s =input()
s += ' '
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    if i in ACGT:
        cnt += 1
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, split(input()))
print(c, a, b)

Fixed submission:
a, b, c = map(int, input().split())
print(c, a, b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

mod = 10**9+7

array = [0] * 60

for i in a:
    for j in range(len(bin(i))-2):
        # print(bin(i),i >> j & 1)
        array[j] += (i >> j) & 1

ans = 0
# print(array)

for i in range(60):
    ans += array[i] * (n-array[i]) * 2**i

print(ans % mod)

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

mod = 10**9+7

array = [0] * 60

for i in a:
    for j in range(len(bin(i))-2):
        # print(bin(i),i >> j & 1)
        array[j] += (i >> j) & 1

ans = 0
# print(array)

for i in range(60):
    ans += array[i] * (n-array[i]) * 2**i

print(ans % mod)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

tmp = 0

for i in range(n-1):
    for j in range(i+1,n):
        tmp += a[i] ^ a[j]

print(tmp % (10**9+7))

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

mod = 10**9+7

array = [0] * 60

for i in a:
    for j in range(len(bin(i))-2):
        # print(bin(i),i >> j & 1)
        array[j] += (i >> j) & 1

ans = 0
# print(array)

for i in range(60):
    ans += array[i] * (n-array[i]) * 2**i

print(ans % mod)
Buggy python submission (verdict: Runtime Error):
import itertools as it

x = int(input())
f = 0

c = x // 100

l = list(it.combinations(range(100,106),c))

for i in l:
    if x % sum(i) == 0:
        f = 1

if f:
    print(1)
else:
    print(0)

Fixed submission:
x = int(input())

n = x // 100
f = 0

for j in range(n+1):
    if j*100 <= x <= j*105:
        f = 1

if f:
    print(1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import math as m

a, b, x = map(int,input().split())

z = a ** 2 * b

if z / 2 >= x:
  ap = x * 2 / a / b
  at = m.degrees(m.atan(b/ap))
  print(at)
else:
  bp = b - x / (a ** 2)
  bt =　m.degrees(m.atan(bp*2/a))
  print(bt)

Fixed submission:
import math as m

a, b, x = map(int,input().split())

z = a ** 2 * b

if z / 2 >= x:
  ap = x * 2 / a / b
  at = m.degrees(m.atan(b/ap))
  print(at)
else:
  bp = b - x / (a ** 2)
  bt = m.degrees(m.atan(bp*2/a))
  print(bt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().split())
b = map(int,input().split())
c = map(int,input().split())

s = 0

for i in a:
  s =+ b[i]
  if b[i] == b[i+1] -1:
    s =+ c[i]

print(s)
    

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

s = 0
a.append(0)

for i in range(n):
  s += b[i]
  if a[i]+1 == a[i+1]:
    s += c[a[i]-1]

print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
ans = (pow(n,2) - n) / 2
if not n == 2:
  print(int(ans))
else:
  print(2)

Fixed submission:
s = str(input())
t = str(input())
st = tuple(s)
tt = tuple(t)

cnt = 0

for i in range(len(st)):
  if st[i] == tt[i]:
    cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
ans = (pow(n,2) - n) / 2
if not n 2:
  print(int(ans))
else:
  print(2)

Fixed submission:
n = int(input())
ans = 0
ans = (pow(n,2) - n) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
f = 0

for i in range(1,n):
    a = h[i-1] - h[i]
    if a > 1:
        break
    elif a == 1:
        if f == 1:
            break
        f = 1
    else:
        f = 0

    if i == n - 1:
        f = 2

if f == 2 or n == 1:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())

cnt = 0

for i in range(1,n+1):
    ln = len(str(i))
    if ln % 2 == 1:
        cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
f = 0

for i in range(1,n):
    a = h[i-1] - h[i]
    if a > 1:
        break
    elif a == 1:
        if f == 1:
            break
        f = 1
    elif a == 0:
        pass
    else:
        f = 0
else:
    if i == n - 1:
        f = 2

if f == 2 or n == 1:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
f = 0

for i in range(1,n):
    a = h[i-1] - h[i]
    if a > 1:
        break
    elif a == 1:
        if f == 1:
            break
        f = 1
    elif a == 0:
        pass
    else:
        f = 0

    if i == n - 1:
        f = 2

if f == 2 or n == 1:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
b = []

for i in range(n):
    t = int(input())
    a.append(t)
    b.append(t)

b.sort()
m = 0
l = n+1

for i in range(n):
    m = 0
    l = n+1
    if a[i] != b[-1]:
        print(b[-1])
        continue
    while a[i] != b[(m+l)//2]:
        if a[i] < b[(m+l)//2]:
            l //= 2
        else:
            m = i
    tmp = b[(m+l)//2]
    b[(m+l)//2] = 0
    print(max(b))
    b[(m+l)//2] = tmp

Fixed submission:
n = int(input())
a = []
b = []

for i in range(n):
    t = int(input())
    a.append(t)
    b.append(t)

b.sort()

for i in range(n):
    if a[i] != b[-1]:
        print(b[-1])
        continue
    else:
        print(b[-2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
b = []

for i in range(n):
    t = int(input())
    a.append(t)
    b.append(t)

b.sort()
m = 0
l = n+1

for i in range(n):
    m = 0
    l = n+1
    while a[i] != b[(m+l)//2]:
        if a[i] < b[(m+l)//2]:
            l //= 2
        else:
            m = i
    tmp = b[(m+l)//2]
    b[(m+l)//2] = 0
    print(max(b))
    b[(m+l)//2] = tmp

Fixed submission:
n = int(input())
a = []
b = []

for i in range(n):
    t = int(input())
    a.append(t)
    b.append(t)

b.sort()

for i in range(n):
    if a[i] != b[-1]:
        print(b[-1])
        continue
    else:
        print(b[-2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
b = []

for i in range(n):
    t = int(input())
    a.append(t)
    b.append(t)

for i in range(n):
    b.sort()
    b.remove(a[i])
    print(b[-1])
    b.append(a[i])
    b.sort()


Fixed submission:
n = int(input())
a = []
b = []

for i in range(n):
    t = int(input())
    a.append(t)
    b.append(t)

b.sort()

for i in range(n):
    if a[i] != b[-1]:
        print(b[-1])
        continue
    else:
        print(b[-2])
Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int,input().split())

n = min(l+4048, r)

ans = 2018
tmp = 2018

for i in range(l,n+1):
    for j in range(i+1,n+1):
        tmp = (i*j) % 2019
        ans = min(ans, tmp)

print(ans)

Fixed submission:
l, r = map(int,input().split())

n = min(l+2020, r)

ans = 2018

for i in range(l,n+1):
    if ans == 0:
        break
    for j in range(i+1,n+1):
        ans = min(ans, (i*j) % 2019)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K=input().split()
N = int(N)
K = int(K)
e = [0]*N

for i in range(N):
    e[i] = int(input())

for i in range(N):
    for j in range(N):      
        if e[i] < e[j]:
            tmp = e[i]
            e[i] = e[j]
            e[j] = tmp

f = [0]*(N - K + 1)
for i in range(N-K+1):
    f[i] = e[K + i - 1] - e[i]

print(np.min(np.array(f)))

Fixed submission:
import numpy as np
N,K=input().split()
N = int(N)
K = int(K)
e = [0]*N

for i in range(N):
    e[i] = int(input())

#for i in range(N):
#    for j in range(N):      
#        if e[i] < e[j]:
#            tmp = e[i]
#            e[i] = e[j]
#            e[j] = tmp

e = list(sorted(e))

f = [0]*(N - K + 1)
for i in range(N-K+1):
    f[i] = e[K + i - 1] - e[i]

print(np.min(np.array(f)))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
K = int(input())

e = [0]*N

for i in range(N):
    e[i] = int(input())

for i in range(N):
    for j in range(N):      
        if e[i] < e[j]:
            tmp = e[i]
            e[i] = e[j]
            e[j] = tmp

f = [0]*(N - K + 1)
for i in range(N-K+1):
    f[i] = e[K + i - 1] - e[i]

print(np.min(np.array(f)))

Fixed submission:
import numpy as np
N,K=input().split()
N = int(N)
K = int(K)
e = [0]*N

for i in range(N):
    e[i] = int(input())

#for i in range(N):
#    for j in range(N):      
#        if e[i] < e[j]:
#            tmp = e[i]
#            e[i] = e[j]
#            e[j] = tmp

e = list(sorted(e))

f = [0]*(N - K + 1)
for i in range(N-K+1):
    f[i] = e[K + i - 1] - e[i]

print(np.min(np.array(f)))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
K = int(input())

e = [0]*N

for i in range(N):
    e[i] = int(input())

for i in range(N):
    print("i",i)
    for j in range(N):      
        if e[i] < e[j]:
            tmp = e[i]
            e[i] = e[j]
            e[j] = tmp

f = [0]*(N - K + 1)
for i in range(N-K+1):
    f[i] = e[K + i - 1] - e[i]

print(np.min(np.array(f)))

Fixed submission:
import numpy as np
N,K=input().split()
N = int(N)
K = int(K)
e = [0]*N

for i in range(N):
    e[i] = int(input())

#for i in range(N):
#    for j in range(N):      
#        if e[i] < e[j]:
#            tmp = e[i]
#            e[i] = e[j]
#            e[j] = tmp

e = list(sorted(e))

f = [0]*(N - K + 1)
for i in range(N-K+1):
    f[i] = e[K + i - 1] - e[i]

print(np.min(np.array(f)))
Buggy python submission (verdict: Runtime Error):
H,W = input().split()
H = int(H)
W = int(W)

shw = [list(map(str, input())) for _ in range(W)]

        

for i in range(1,H-1):
    for j in range(1,W-1):
        if shw[i][j] == str('#'):
            if shw[i][j] != shw[i+1][j] and shw[i][j] != shw[i][j+1] and shw[i][j] != shw[i-1][j] and shw[i][j] != shw[i][j-1]:
                print("No")
                exit()
print("Yes")

Fixed submission:
H,W=map(int,input().split())
S=["."+input()+"." for i in range(H)]
S=["."*(W+2)]+S+["."*(W+2)]
flag=0
for i in range(H):
    for j in range(W):
        if S[i][j]=="#":
            if S[i-1][j]=="." and S[i+1][j]=="." and S[i][j-1]=="." and S[i][j+1]==".":
                flag=1
print("Yes" if flag==0 else "No")
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

print(6-a+b)

Fixed submission:
a=int(input())
b=int(input())
print(6-(a+b))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a*b if a or b >= 10 "-1")

Fixed submission:
a,b=map(int,input().split())
if a >=10:
  print(-1)
elif b >= 10:
  print(-1)
else:
  print(a*b)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n == 2:
    print(a+b)
else:
    print("Hello World")

Fixed submission:
n=int(input())
if n == 1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n == 1:
    print("Hello World")
else:
    print(a+b)

Fixed submission:
n=int(input())
if n == 1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
# A - Task Scheduling Problem
*a=map(int,input().split())
print(max(a)- min(a)

Fixed submission:
*a,=map(int,input().split())
print(max(a)-min(a))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a or b => 9:
  print(":(")
else:
  print("Yay!")

Fixed submission:
a,b=map(int,input().split())
if a>8 or b>8:
  print(":(")
else:
  print("Yay!")
Buggy python submission (verdict: Runtime Error):
input_list = input().split()
a = int(input_list[2])
b = int(input_list[0])
c = int(input_list[1])
print("{} {} {}".format(a, b, c)

Fixed submission:
input_list = input().split()
a = int(input_list[2])
b = int(input_list[0])
c = int(input_list[1])
print("{} {} {}".format(a, b, c))
Buggy python submission (verdict: Runtime Error):
n_k = [int(i) for i in input().split()]
n = n_k[0]
k = n_k[1]
r = n % k
r_1 = abs(r - k)
min = np.array([r, r_1]).min()
print(min)

Fixed submission:
import numpy as np
n_k = [int(i) for i in input().split()]
n = n_k[0]
k = n_k[1]
r = n % k
r_1 = abs(r - k)
min = np.array([r, r_1]).min()
print(min)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if (1 <= a <= 9) and (1<= b <= 9):
  print("{}".format(a*b))
else:
  print("{}".format(-1))


Fixed submission:
x = input().split()

a = int(x[0])
b = int(x[1])

if (1 <= a <= 9) and (1<= b <= 9):
  print("{}".format(a*b))
else:
  print("{}".format(-1))

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if (1 <= a <= 9) and (1<= b <= 9):
  print(a * b)
else:
  print("-1")

Fixed submission:
x = input().split()

a = int(x[0])
b = int(x[1])

if (1 <= a <= 9) and (1<= b <= 9):
  print("{}".format(a*b))
else:
  print("{}".format(-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())

for i in range(9):
  i += 1
  if (n > 81):
    flag = 1
    break
  if n % i == 0:
    if (0 <= n/i <= 9):
      break
    else:
      continue
  else:
    if (i == 9):
      flag = 1
    else:
      continue

if (flag == 0):
  print("Yes")
else:
  print("No")

      

Fixed submission:
n = int(input())

flag = 0

for i in range(9):
  i += 1
  if (n > 81):
    flag = 1
    break
  if n % i == 0:
    if (0 <= n/i <= 9):
      break
    else:
      continue
  else:
    if (i == 9):
      flag = 1
    else:
      continue

if (flag == 0):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = input().split()
n = int(a[0])
x = int(a[1])
l_str_list = input().split()
d = 0
answer = 0

for i in n:
  d += int(l_str_list[i])
  if d > x:
    answer = i + 1
    break;
print(answer)

Fixed submission:
a = input().split()
n = int(a[0])
x = int(a[1])
l_str_list = input().split()
d = 0
answer = n + 1

for i in range(n):
  d += int(l_str_list[i])
  if d > x:
    answer = i + 1
    break
  if d == x:
    answer = i + 2
    break
print(answer)
Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())

if k == 1:
    print("0")

else:
    print(n - k)

Fixed submission:
x = input().split()
n = int(x[0])
k = int(x[1])

if k == 1:
    print("0")

else:
    print(n - k)

Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())

diff = n - k

if k == 1:
    print("0")

print(diff)


Fixed submission:
x = input().split()
n = int(x[0])
k = int(x[1])

if k == 1:
    print("0")

else:
    print(n - k)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
 
ans = len(S) - 1
left = 0 # リーダーより左
right = 0 # リーダーより右

for i in range(len(S)):
    if i > 0:   
        left = S[0:i].count("W")
    right = S[i + 1 :].count("E")
    ans = min(ans, left + right)
print(ans)

Fixed submission:
N = int(input())
S = input()
 
left = 0
right = S[1:].count("E")
ans = left + right

for i in range(1, N):
    if S[i - 1] == "W":
        left += 1
    if S[i] == "E":
        right -= 1 
    ans = min(ans, left + right)
print(ans)