Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
a=len(L)
#print(L)
for i in range(a-2):
  count1=0
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
        count1+=1
        break
    if count1==1:
         break
print(count)



Fixed submission:
a,b=map(int,input().split())
if a>=2*b:
  print(a-2*b)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
a=len(L)
#print(L)
for i in range(a-2):
  count1=0
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
        count1+=1
        break
    if count1==1:
         break
print(count)

Fixed submission:
a,b=map(int,input().split())
if a>=2*b:
  print(a-2*b)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
L.sort()
L.reverse()
count=0
count1=0
a=len(L)
#print(L)
for i in range(a-2):
  for j in range(i+1,a-1):
    for k in range(j+1,a):
      if L[i]<L[j]+L[k]:
        count+=1
        #print(L[i],L[j],L[k])
      else:
         break

print(count)


Fixed submission:
a,b=map(int,input().split())
if a>=2*b:
  print(a-2*b)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>=2*b:
  print(a-2*b)
else:
  print(0)

Fixed submission:
a,b=map(int,input().split())
if a>=2*b:
  print(a-2*b)
else:
  print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N=int(input())
A=list(map(int,input().split()))
ans=np.zeros(N)
for i in A:
  ans[i-1]=A.index(i)+1
for j in ans:
  print(int(j),end=" ")

Fixed submission:
import numpy as np
N=int(input())
A=list(map(int,input().split()))
ans=np.zeros(N)
count=0
for i in A:
  ans[i-1]=count+1
  count+=1
for j in ans:
  print(int(j),end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
  print(A.index(i)+1,end=" ")

Fixed submission:
import numpy as np
N=int(input())
A=list(map(int,input().split()))
ans=np.zeros(N)
count=0
for i in A:
  ans[i-1]=count+1
  count+=1
for j in ans:
  print(int(j),end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K,Q=map(int,input().split())
A=[]
for i in range(Q):
  a=int(input())
  A.append(a)
score=np.full(N,K)
for j in range(Q):
  for k in range(len(score)):
    if k==A[j]-1:
      pass
    else:
      score[k]-=1
for l in range(len(score)):
  if score[l]>0:
    print("Yes")
  else:
    print("No")

Fixed submission:
import numpy as np
N,K,Q=map(int,input().split())
score=np.full(N,K)
for i in range(Q):
  a=int(input())
  score[a-1]+=1
for j in score:
  if j-Q>0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=list(map(int,input().split()))
for i in range(M):
  A=sorted(A)
  A[len(A)-1]=A[len(A)-1]//2
print(sum(A))

Fixed submission:
N,M=map(int,input().split())
A=list(map(int,input().split()))

while M>0:
    A.sort(reverse=True)
    if A[0]==0:
        break
    judge=A[0]//2
    for i in range(len(A)):
        if A[i]>judge and M>0:
            A[i]=A[i]//2
            M-=1
        else:
            break
print(sum(A))
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
now=0
max=0
count=0
while now>len(N)-1:
  if H[now]>=H[now+1]:
    count+=1
    now+=1
  else:
    now+=1
    if count>max:
      max=count
    count=0
print(max)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
now=0
max=0
count=0
while now<N-1:
  if H[now]>=H[now+1]:
    count+=1
    now+=1
  else:
    now+=1
    if count>max:
      max=count
    count=0
if count>max:
    max=count
print(max)
Buggy python submission (verdict: Time Limit Exceeded):
ans=0
N=int(input())
for i in range(N-1):
  ans=ans+i+1
print(ans)

Fixed submission:
N=int(input())
print(N*(N-1)//2)

Buggy python submission (verdict: Runtime Error):
ans=0
for i in range(N-1):
  ans=ans+i+2
print(ans)

Fixed submission:
N=int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
arr = []
min = N
for i in range(1, N+1):
  if abs(L+i-1) < abs(min):
    min = L+i-1
  arr.append(L+i-1)

arr.remove(min)

print("{}".format(sum(arr)))

Fixed submission:
N, L = map(int, input().split())
arr = []
min = N+abs(L)
for i in range(1, N+1):
  if abs(L+i-1) < abs(min):
    min = L+i-1
  arr.append(L+i-1)

arr.remove(min)

print("{}".format(sum(arr)))
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
A, B, C, D = map(int, input().split())

def gcd(*numbers):
    def gcd(a, b):
        while b != 0:
            a, b = b, a % b
        return a
    return reduce(gcd, numbers)

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

result = 0
while(True):
  if A%C == 0 or A%D == 0:
    A += 1
  else:
    break

result += (B-A+1) - (B//C - A//C) - (B//D - A//D)
l = lcm(C, D)
result += (B//l - A//l)

print("{}".format(result))

Fixed submission:
from functools import reduce
A, B, C, D = map(int, input().split())
if C == 1 or D == 1:
  print(0)
  exit()

def gcd(*numbers):
    def gcd(a, b):
        while b != 0:
            a, b = b, a % b
        return a
    return reduce(gcd, numbers)

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

result = 0

if A%C == 0 or A%D == 0:
  A += 1

result += (B-A+1) - (B//C - A//C) - (B//D - A//D)
l = lcm(C, D)
result += (B//l - A//l)

print("{}".format(result))
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for a in A: 
    for b in B:
        for c in C:
            if 500*a + 100*b + 50*c == X:
                count += 1
    
print(count)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res=0
for  i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500*i + 100*j + 50*k == X:
                res += 1
print(res)
Buggy python submission (verdict: Runtime Error):
N, row = input().split()
unit1, unit2 = row[:len(row)//2], row[len(row)//2:]
if unit1 == unit2:
    print('Yes')
else:
    print('No')

Fixed submission:
N = input()
row = input()
unit1, unit2 = row[:len(row)//2], row[len(row)//2:]
if unit1 == unit2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
from collections import deque

n,x = map(int,input().split())

l = deque(list(map(int,input().split())))
count = 0
while count <= x:
    count += l.popleft()

print(n-len(l))

Fixed submission:
from collections import deque

n,x = map(int,input().split())

l = deque(list(map(int,input().split())))
count = 0

if sum(l) <= x:
    print(n+1)
else:
    while count <= x:
        count += l.popleft()
        if len(l) == 0:
            break

    print(n-len(l))

Buggy python submission (verdict: Runtime Error):
from collections import deque

n,x = map(int,input().split())

l = deque(list(map(int,input().split())))
count = 0
while count < x:
    count += l.popleft()

print(n-len(l)+1)

Fixed submission:
from collections import deque

n,x = map(int,input().split())

l = deque(list(map(int,input().split())))
count = 0

if sum(l) <= x:
    print(n+1)
else:
    while count <= x:
        count += l.popleft()
        if len(l) == 0:
            break

    print(n-len(l))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

def fib(n):
    if n == 0:
        return 0
    else:
        a0 = 0
        a1 = 1
        for i in range(n-1):
            b = a1
            a1 += a0
            a0 = b
        return a1

count = 1
b = 0
for i in range(m):
    a = int(input())
    if a == 1:
        b = 1
        continue
    if num == 1:
        count *= 0
        break
    if b == 0:
        num = a - b
    else:
        num = a - b - 1
    count *= fib(num)
    b = a 
#     print(b, count, num)
    
count *= fib(n - b)

print(count%1000000007)

Fixed submission:
def main():
    n,m = map(int, input().split())
    stairs = [1]*(n+1)
    mod = 1000000007
    for _ in range(m):
        stairs[int(input())] = 0
    for i in range(2, n+1):
        stairs[i] = (stairs[i-2] + stairs[i-1]) * stairs[i]
    print(stairs[n] % mod)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = int(input())
num = reduce(lambda x,y: x*y, list(map(int, input().split())))
count = 0

while num%2 == 0:
    num = num//2
    count += 1
    
print(count)

Fixed submission:
n = int(input())
nums = list(map(int, input().split()))
iters = 0
count = 0

while len(nums) != 0:
    size = len(nums)
    nums = list(map(lambda x: x//2, list(filter(lambda x:x%2 == 0, nums))))
    count += (size - len(nums))*iters
    iters += 1
    
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
ks = [_ for _ in range(k+1)]

count = 0

for ksk1 in ks:
    for ksk2 in ks:
        for ksk3 in ks:
            if s == ksk1 + ksk2 + ksk3:
                count += 1
            
print(count)

Fixed submission:
k, s = map(int, input().split())
ks = [_ for _ in range(k+1)]

count = 0

for ksk1 in ks:
    for ksk2 in ks:
        z = s - ksk1 - ksk2
        if 0 <= z <= k:
            count += 1
            
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
ks = [_ for _ in range(k+1)]

count = 0

for ksk1 in ks:
    for ksk2 in ks:
        if s -(ksk1 + ksk2) in ks:
            count += 1
            
print(count)

Fixed submission:
k, s = map(int, input().split())
ks = [_ for _ in range(k+1)]

count = 0

for ksk1 in ks:
    for ksk2 in ks:
        z = s - ksk1 - ksk2
        if 0 <= z <= k:
            count += 1
            
print(count)
Buggy python submission (verdict: Runtime Error):
s = input()
lst = ['SUN','MON','TUE','WED','THU','FRI','SAT']

for i in range(len(lst)):
  if lst[i] = s:
    print(7 - i)

Fixed submission:
s = input()
lst = ['SUN','MON','TUE','WED','THU','FRI','SAT']

for i in range(len(lst)):
  if lst[i] == s:
    print(7 - i)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if N % 2 ==1:
    print("No")
else:
    if S[:int(N/2)]==S[int(N/2):]:
        print("Yes")
    else:
        print("No")
 
　　

Fixed submission:
N = int(input())
S = input()

if N % 2 ==1:
    print("No")
else:
    if S[:int(N/2)]==S[int(N/2):]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())

if N % 2 ==1:
  print("No")
else:
  if S[:int(N/2)]==S[int(N/2):]:
    print("Yes")
  else:
    print("No")
 
　　

Fixed submission:
N = int(input())
S = input()

if N % 2 ==1:
    print("No")
else:
    if S[:int(N/2)]==S[int(N/2):]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())


li = [N*A,B]
print(min(li()))

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

x = N*A
y = B

li = [x,y]
print(min(li))

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

x = N*A
y = B
li = [x,y]
print(min(li()))

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

x = N*A
y = B

li = [x,y]
print(min(li))

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
x = N * A
y = B

li = [x,y]
print(min(li()))

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

x = N*A
y = B

li = [x,y]
print(min(li))

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

li = [N , A , B]
print(min(li()))

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

x = N*A
y = B

li = [x,y]
print(min(li))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

li[N*A,B]
print(str(min(li())))

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

x = N*A
y = B

li = [x,y]
print(min(li))

Buggy python submission (verdict: Runtime Error):
x = N * A
y = B

li = [x,y]
print(min(li))

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

x = N*A
y = B

li = [x,y]
print(min(li))
Buggy python submission (verdict: Runtime Error):
S = input()

li = S.split()
if ((li[0] == li[1] and li[2] ==li[3]) or (li[0] == li[2] and li[1] == li[3])
    or (li[0] ==li[3] and li[1] == li[2]):
    print('Yes')
else:
    print('No')

Fixed submission:
S = input()

if (S[0] == S[1] and S[1] != S[2] and S[2] ==S[3]):
    print('Yes')
elif (S[0] == S[2] and S[2] != S[1] and S[1] == S[3]):
    print('Yes')
elif (S[0] == S[3] and S[3] != S[1] and S[1] == S[2]):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
S = int(input())

if (S[0] == S[1] or S[1] == S[2] or S[2] == S[3]):
    print('Bad')
else:
    print('Good')

Fixed submission:
S = str(input())

if (S[0] == S[1] or S[1] == S[2] or S[2] == S[3]):
    print('Bad')
else:
    print('Good')
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A >== 13:
    print(B)
elif  A <== 5:
    print(0)
else:
    print(B/2)

Fixed submission:
A, B = map(int, input().split())
if A >= 13:
    print(B)
elif  A <= 5:
    print(0)
else:
    print(int(B/2))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())

S = list(input())

S[K-1] = S[K-1].lower()

for i in range(N):
  s_new += S[i]
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower()

s_new = ""
for i in range(N):
  s_new += S[i]
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower()

for i in S:
  s_new += i
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower()

s_new = ""
for i in range(N):
  s_new += S[i]
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower()

for i in S:
    s_new += i
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower()

s_new = ""
for i in range(N):
  s_new += S[i]
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower

for i in S:
    s_new += i
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower()

s_new = ""
for i in range(N):
  s_new += S[i]
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower

for i in S[0,K]:
    s_new += S[i]
    
print(s_new)

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

S = list(input())

S[K-1] = S[K-1].lower()

s_new = ""
for i in range(N):
  s_new += S[i]
    
print(s_new)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = str(input())
S_new = S.lower[K-1]
print(S_new)

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

S = list(input())

S[K-1] = S[K-1].lower()

s_new = ""
for i in range(N):
  s_new += S[i]
    
print(s_new)

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

print(S.lower(K-1))

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

S = list(input())

S[K-1] = S[K-1].lower()

s_new = ""
for i in range(N):
  s_new += S[i]
    
print(s_new)
Buggy python submission (verdict: Runtime Error):
# get the date as a string
s = input()

WEEKDAYS=['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
integer_day = WEEKDAYS[::-1].indexof(s) + 1
print(integer_day)

Fixed submission:
# get the date as a string
s = input()

WEEKDAYS=['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
integer_day = WEEKDAYS[::-1].index(s) + 1
print(integer_day)

Buggy python submission (verdict: Runtime Error):
# get the date as a string
s = raw_input()

WEEKDAYS=['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
integer_day = WEEKDAYS[::-1].indexof(s) + 1
print(integer_day)

Fixed submission:
# get the date as a string
s = input()

WEEKDAYS=['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
integer_day = WEEKDAYS[::-1].index(s) + 1
print(integer_day)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N,K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" "))) # consumption coefficient of members
F = list(map(int, input().split(" "))) # difficulty of food

# pair fastest eaters (low consumption coefficient) with most difficult foods
A.sort()
F.sort(reverse=True)
A = np.array(A)
F = np.array(F)

maxT = np.max(A*F)
# use binary search to find lowest possible T
left = -1
right = maxT
while left+1< right:
    mid = (left+right)//2
    if np.maximum(0, A - (mid//F)).sum() <= K:
        right  = mid
    else:
        left = mid
print(right)



Fixed submission:
A, B = list(map(int, input().split(" ")))
if not A >9 and not B >9:
    print(A*B)
else:
    print("-1")

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

N,K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" "))) # consumption coefficient of members
F = list(map(int, input().split(" "))) # difficulty of food

# pair fastest eaters (low consumption coefficient) with most difficult foods
A.sort()
F.sort(reverse=True)
A = np.array(A)
F = np.array(F)

def how_many_K(A,F,T,K):
    """
    Returns whether the number of training sessions needed for group A with foods F to have a score equal to T is less than K
    """
    num_trains = 0
    for i in range(len(A)):
        a = A[i]
        f = F[i]
        num_trains += max(0, a-T//f)

    if num_trains > K:
        return False
    else:
        return True

maxT = np.max(A*F)
# use binary search to find lowest possible T
left = -1
right = maxT
while left+1< right:
    mid = (left+right)//2
    if how_many_K(A,F,mid,K):
        right  = mid
    else:
        left = mid
print(right)



Fixed submission:
A, B = list(map(int, input().split(" ")))
if not A >9 and not B >9:
    print(A*B)
else:
    print("-1")
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" "))) # consumption coefficient of members
F = list(map(int, input().split(" "))) # difficulty of food

# pair fastest eaters (low consumption coefficient) with most difficult foods
A.sort()
F.sort(reverse=True)
A = np.array(A)
F = np.array(F)

def how_many_K(A,F,T,K):
    """
    Returns whether the number of training sessions needed for group A with foods F to have a score equal to T is less than K
    """
    num_trains = 0
    for i in range(len(A)):
        a = A[i]
        f = F[i]
        num_trains += max(0, a-T//f)

    if num_trains > K:
        return False
    else:
        return True

maxT = np.max(A*F)
# use binary search to find lowest possible T
left = -1
right = maxT
while left+1< right:
    mid = (left+right)//2
    if how_many_K(A,F,mid,K):
        right  = mid
    else:
        left = mid
print(right)

Fixed submission:
import numpy as np

N,K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" "))) # consumption coefficient of members
F = list(map(int, input().split(" "))) # difficulty of food

# pair fastest eaters (low consumption coefficient) with most difficult foods
A.sort()
F.sort(reverse=True)
A = np.array(A)
F = np.array(F)

maxT = np.max(A*F)
# use binary search to find lowest possible T
left = -1
right = maxT
while left+1< right:
    mid = (left+right)//2
    if np.maximum(0, A - (mid//F)).sum() <= K:
        right  = mid
    else:
        left = mid
print(right)
Buggy python submission (verdict: Time Limit Exceeded):
town_graph = {}
road_graph = {}

N,M,L = list(map(int, input().split()))
# N = num towns
# M = num roads
# L = fuel tank capacity

for _ in range(M):
    A,B,C = list(map(int, input().split()))
    if not A in town_graph:
        town_graph[A] = [B]
    else:
        town_graph[A].append(B)
    if not B in town_graph:
        town_graph[B] = [A]
    else:
        town_graph[B].append(B)

    road_graph[tuple(sorted([A,B]))] = C
    road_graph[tuple([A,A])] = 0
    road_graph[tuple([B,B])] = 0

Q = int(input())
queries = []
for _ in range(Q):
    queries.append(list(map(int,input().split())))

#print(town_graph)
#print(road_graph)

# initialize remaining road_graph distances:
for i in range(1, N+1):
    for j in range(1, N+1):
        key = tuple(sorted([i,j]))
        if not key in road_graph:
            road_graph[key] = float('inf')

# use flord warshall to find min path between all towns
for k in range(1,N+1):
    for i in range(1,N+1):
        for j in range(1,N+1):
            if road_graph[tuple(sorted([i,j]))] > road_graph[tuple(sorted([i,k]))] + road_graph[tuple(sorted([k,j]))]:
                road_graph[tuple(sorted([i,j]))] = road_graph[tuple(sorted([i,k]))] + road_graph[tuple(sorted([k,j]))]

#print(road_graph)

# if the two towns can be travelled to on one tank, add to our fuel graph with distance 1
fuel_graph = road_graph.copy()
for town_pair in road_graph:
    if road_graph[town_pair] <= L:
        fuel_graph[town_pair] = 1
    else:
        fuel_graph[town_pair] = float('inf')

#print(road_graph)
#print(fuel_graph)

# use flord warshall to find min number of fuel tanks to travel between two towns
for k in range(1,N+1):
    for i in range(1,N+1):
        for j in range(1,N+1):
            if fuel_graph[tuple(sorted([i,j]))] > fuel_graph[tuple(sorted([i,k]))] + fuel_graph[tuple(sorted([k,j]))]:
                fuel_graph[tuple(sorted([i,j]))] = fuel_graph[tuple(sorted([i,k]))] + fuel_graph[tuple(sorted([k,j]))]
#print(fuel_graph)
for query in queries:
    num_tanks = fuel_graph[tuple(sorted(query))] - 1
    if num_tanks != float('inf'):
        print(num_tanks)
    else:
        print("-1")


Fixed submission:
from scipy.sparse.csgraph import floyd_warshall

N,M,L = list(map(int, input().split()))

edges = [[0] * N for _ in range(N)]

for _ in range(M):
    A,B,C = list(map(int, input().split()))
    edges[A-1][B-1] = C
    edges[B-1][A-1] = C

Q = int(input())
queries = []

for _ in range(Q):
    queries.append(list(map(int,input().split())))

# use flord warshall to find min path between all towns
edges = floyd_warshall(edges)

# if the two towns can be travelled to on one tank, add to our fuel graph with distance 1
for i in range(N):
    for j in range(N):
        if edges[i][j] <= L:
            edges[i][j] = 1
        else:
            edges[i][j] = 0

# use flord warshall to find min number of fuel tanks to travel between two towns
edges = floyd_warshall(edges)

for query in queries:
    s = query[0] - 1
    t = query[1] - 1
    num_tanks = edges[s][t] - 1
    if num_tanks != float('inf'):
        print(int(num_tanks))
    else:
        print("-1")
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A<=0 or 10<=A:
    print(-1)
elif B<=0 or 10<=B:
    print(-1)
else:
    print(A*B)


Fixed submission:
x,y = map(int,input().split())
if x<=9 and y<=9:
    print(x*y)
else:
    print(-1)