Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = list(map(int, input().split()))
Y = 1
for i in range(0, N):
  Y = X[i] * Y
if Y <= 1000000000000000000:
  print(Y)
else:
  print(-1)

Fixed submission:
import sys

N = int(input())
X = list(map(int, input().split()))
if min(X) == 0:
  print(0)
  sys.exit()
Y = X[0]
for i in range(1, N):
  Y = X[i] * Y
  if Y > 10 ** 18:
    print(-1)
    sys.exit()
print(Y)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = list(map(int, input().split()))
Y = 1
for i in range(0, N):
  Y = X[i] * Y
if Y <= 10 ** 18:
  print(Y)
else:
  print(-1)

Fixed submission:
import sys

N = int(input())
X = list(map(int, input().split()))
if min(X) == 0:
  print(0)
  sys.exit()
Y = X[0]
for i in range(1, N):
  Y = X[i] * Y
  if Y > 10 ** 18:
    print(-1)
    sys.exit()
print(Y)
Buggy python submission (verdict: Runtime Error):
x = input()

if x = "ABC":
  print("ARC")
else:
  print("ABC")

Fixed submission:
x = input()

if x == "ABC":
  print("ARC")
else:
  print("ABC")
Buggy python submission (verdict: Runtime Error):
N = int(input())
str1 = input()
str2 = input()

ans = ''
for i in range(0, N):
  ans += str1[i] + str2[i]
print(ans)

Fixed submission:
N = int(input())
str = input()
str = str.split()
str1 = str[0]
str2 = str[1]

ans = ''
for i in range(0, N):
  ans += str1[i] + str2[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainly']
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)

Fixed submission:
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainy']
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)

Buggy python submission (verdict: Runtime Error):
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainly']
print(list[1])
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)

Fixed submission:
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainy']
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)
Buggy python submission (verdict: Runtime Error):
n =int(input())
ls =list(map(int,input().split()))
if 0 in ls:
	print(0)
else:
	ans = 1
	for a in ls:
		ans *= a
		if ans > 1000000000000000000:
			ans = -1;
			break;
		
print(ans)

Fixed submission:
n =int(input())
ls =list(map(int,input().split()))
if 0 in ls:
	print(0)
else:
	ans = 1
	for a in ls:
		ans *= a
		if ans > 1000000000000000000:
			ans = -1;
			break;
		
	print(ans)

Buggy python submission (verdict: Runtime Error):
n =int(input())
ls =list(map(int,input().split()))
if 0 in ls:
	print(0)
else:
	ans = 1
	for a in A:
		ans *= a
		if ans > 1000000000000000000:
			ans = -1;
			break;
		
print(ans)

Fixed submission:
n =int(input())
ls =list(map(int,input().split()))
if 0 in ls:
	print(0)
else:
	ans = 1
	for a in ls:
		ans *= a
		if ans > 1000000000000000000:
			ans = -1;
			break;
		
	print(ans)
Buggy python submission (verdict: Runtime Error):
a,b, = map(int,input().split());
c = a*b
print(int(c));

Fixed submission:
import math
from decimal import Decimal
a,b, = map(Decimal,input().split());
c = a*b
print(math.floor(c));
Buggy python submission (verdict: Time Limit Exceeded):
s= input();
q = int(input());
flag = 0;
while(q>0):
    q-=1;
    ls = list(map(str,input().split(" ")));
    if(ls[0]=='1'):
        flag +=1;
    else:
        if(flag%2 == 1):
            if(ls[1]=='2'):
                s=ls[2]+s;
            else:
                s=s+ls[2];
        else:
            
            if(ls[1]=='1'):
                s=ls[2]+s;
            else:
                s=s+ls[2];
if(flag%2==0):
    print(s);
else:
    print(s[::-1])

Fixed submission:
s= input();
q = int(input());
flag = 0;
fornt = "";
back = "";
while(q>0):
    q-=1;
    ls = list(map(str,input().split(" ")));
    if(ls[0]=='1'):
        flag +=1;
    else:
        if(flag%2 == 1):
            if(ls[1]=='2'):
                fornt=ls[2]+fornt;
            else:
                back=back+ls[2];
        else:
            
            if(ls[1]=='1'):
                fornt=ls[2]+fornt;
            else:
                back=back+ls[2];
s = fornt+s+back
if(flag%2==0):
    print(s);
else:
    print(s[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s= input();
q = int(input());
while(q>0):
    q-=1;
    ls = list(map(str,input().split(" ")));
    if(ls[0]=='1'):
        s=s[::-1];
    else:
        if(ls[1]=='1'):
            s=ls[2]+s;
        else:
            s=s+ls[2];
print(s)

Fixed submission:
s= input();
q = int(input());
flag = 0;
fornt = "";
back = "";
while(q>0):
    q-=1;
    ls = list(map(str,input().split(" ")));
    if(ls[0]=='1'):
        flag +=1;
    else:
        if(flag%2 == 1):
            if(ls[1]=='2'):
                fornt=ls[2]+fornt;
            else:
                back=back+ls[2];
        else:
            
            if(ls[1]=='1'):
                fornt=ls[2]+fornt;
            else:
                back=back+ls[2];
s = fornt+s+back
if(flag%2==0):
    print(s);
else:
    print(s[::-1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().strip().split(" ")]
x=1
c=pow(10,18)
for i in range(N):
    if x<c or x!=0:
        x *=A[i]
    
if x>pow(10,18):
    print("-1")
else:
    print(x)

Fixed submission:
a,b=[float(x) for x in input().strip().split(" ")]
x=a*(b*100)/100
print(int(x))

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().strip().split(" ")]
x=1

for i in range(N):
    x *=A[i]
    
if x>pow(10,18):
    print("-1")
else:
    print(x)

Fixed submission:
a,b=[float(x) for x in input().strip().split(" ")]
x=a*(b*100)/100
print(int(x))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
#A=[int(x) for x in input().strip().split(" ")]
A=list(map(int,input().split()))
x=1
c=1000000000000000000
for i in range(N):
    if x<c or x!=0:
        x *=A[i]
if x>c:
    print("-1")
else:
    print(x)

Fixed submission:
def main():
    N=int(input())
    A=list(map(int,input().split()))
    if 0 in A:
        print(0)
        return
    
    prod=1
    for a in A:
        prod *=a
        if prod > 1000000000000000000:
            print(-1)
            return
    
    print(prod)
main()
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split()))
print(str(a.index(0))+1)

Fixed submission:
a=list(map(int,input().split()))
print(a.index(0)+1)

Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split()))
print(str(a.index(0))+1)

Fixed submission:
a=list(map(int,input().split()))
print(a.index(0)+1)

Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split())
print(a.index(0)+1)

Fixed submission:
a=list(map(int,input().split()))
print(a.index(0)+1)

Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split())
print(a.index(0)+1)

Fixed submission:
a=list(map(int,input().split()))
print(a.index(0)+1)
Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
if(n!=0):
    a=list(map(int,input().split()))
else:
    a=[]

if x not in a:
    print(x)
else:
    a.sort()
    idx=a.index(x)
    i=max(idx-1,0)
    j=min(idx+1,n-1)
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=x-d
            break
        else:
            i-=1
        if(a[j]!=x+d):
            ans=x+d
            break
        else:
            j+=1
        d+=1
    print(ans)


Fixed submission:
x,n=map(int,input().split())
if(n!=0):
    a=list(map(int,input().split()))
else:
    a=[]

if x not in a:
    print(x)
else:
    a.sort()
    idx=a.index(x)
    i=max(idx-1,0)
    j=min(idx+1,n-1)
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=x-d
            break
        else:
            i=max(i-1,0)
        if(a[j]!=x+d):
            ans=x+d
            break
        else:
            j=min(j+1,n-1)
        d+=1
    print(ans)

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
if(n!=0):
    a=list(map(int,input().split()))
else:
    a=[]
if not x in a:
    print(x)
else:
    a.sort()
    i=a.index(x)-1
    j=i+2
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=a[i]
            break
        else:
            i-=1
        if(a[j]!=x+d):
            ans=a[j]
            break
        else:
            j+=1
        d+=1
    print(ans)


Fixed submission:
x,n=map(int,input().split())
if(n!=0):
    a=list(map(int,input().split()))
else:
    a=[]

if x not in a:
    print(x)
else:
    a.sort()
    idx=a.index(x)
    i=max(idx-1,0)
    j=min(idx+1,n-1)
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=x-d
            break
        else:
            i=max(i-1,0)
        if(a[j]!=x+d):
            ans=x+d
            break
        else:
            j=min(j+1,n-1)
        d+=1
    print(ans)

Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
a=list(map(int,input().split()))
if not x in a:
    print(x)
else:
    a.sort()
    i=a.index(x)-1
    j=i+2
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=a[i]
            break
        else:
            i-=1
        if(a[j]!=x+d):
            ans=a[j]
            break
        else:
            j+=1
        d+=1
    print(ans)

Fixed submission:
x,n=map(int,input().split())
if(n!=0):
    a=list(map(int,input().split()))
else:
    a=[]

if x not in a:
    print(x)
else:
    a.sort()
    idx=a.index(x)
    i=max(idx-1,0)
    j=min(idx+1,n-1)
    d=1
    ans=0
    while(True):
        if(a[i]!=x-d):
            ans=x-d
            break
        else:
            i=max(i-1,0)
        if(a[j]!=x+d):
            ans=x+d
            break
        else:
            j=min(j+1,n-1)
        d+=1
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
ABCK = [int(x) for x in input().split()]
A=ABCK[0]
B=ABCK[1]
C=ABCK[2]
K=ABCK[3]

n=0

while A>0 and K>0:
  n+=1
  K-=1
  A-=1
  
while B>0 and K>0:
  K-=1
  B-=1
  
while C>0 and K>0:
  n-=1
  C-=1
  K-=1
  
print(n)

Fixed submission:
ABCK = [int(x) for x in input().split()]
A=ABCK[0]
B=ABCK[1]
C=ABCK[2]
K=ABCK[3]

n=0

if K<=A:
  n=K
elif K<=A+B:
  n=A
elif K<=A+B+C:
  n=A-(K-A-B)
  
print(n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = map(int, input().split())
re = 1
for i in l:
  re *= i

if re > 10 ** 18:
	print(-1)
else:
	print(re)


Fixed submission:
def func(l):
	if 0 in l:
		return 0
	re = 1
	for i in l:
		re *= i
		if re > 10 ** 18:
			return -1
	return re
	
n = int(input())
l = list(map(int, input().split()))
print(func(l))
Buggy python submission (verdict: Runtime Error):
import sys
def I_dont_know_what_to_do():
    a = long(input())
    b = long(input())
    c = int(input())

    if a < b:
        n = a
        a = b
        b = n

    s = (a - b + 2 - a % c - b % c) / c
    print(s)


I_dont_know_what_to_do()

Fixed submission:
def main():
    
    end, start, divisor = [int(i) for i in input().split()]
    a = start//divisor - (end-1)//divisor

    print(a)

main()

Buggy python submission (verdict: Runtime Error):
def I_dont_know_what_to_do():
    a = long long int(input())
    b = long long int(input())
    c = int(input())

    if (a - b < 0)
        n = a
        a = b
        b = n

    s = (a - b + 2 - a % c - b % c) / c
    print(s)


I_dont_know_what_to_do()

Fixed submission:
def main():
    
    end, start, divisor = [int(i) for i in input().split()]
    a = start//divisor - (end-1)//divisor

    print(a)

main()
Buggy python submission (verdict: Runtime Error):
def digit():
    N, K = [int(n) for n in input().split()]
    digit = [int(n) for n in input().split()]

    for i in range(N, N*10):
        b = i
        while b != 0:
            if (b % 10) in digit:
                break
            b /= 10
        if b == 0:
            print(i)
            break:

digit()

Fixed submission:
def has_no(s, digits):
    for ch in s:
        if ch in digits:
            return False
    return True

def digit():
    N, K = [int(n) for n in input().split()]
    digits = input().split()

    for i in range(N, N*10):
        s = str(i)
        if has_no(s, digits):
            print(s)
            break

digit()

Buggy python submission (verdict: Runtime Error):
def digit():
    N, K = [int(n) for n in input().split()]
    digit = [int(n) for n in input().split()]

    for i in range(N, N*10):
        b = i
        while b != 0:
            if (b % 10) in digit:
                break
            b /= 10
        if b == 0:
            print(i)
            break:

digit()

Fixed submission:
def has_no(s, digits):
    for ch in s:
        if ch in digits:
            return False
    return True

def digit():
    N, K = [int(n) for n in input().split()]
    digits = input().split()

    for i in range(N, N*10):
        s = str(i)
        if has_no(s, digits):
            print(s)
            break

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

print(a*b)

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

print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a_list = list(map(int, input().split()))

for i in range(1, N+1):
    print(a_list.count(i))

Fixed submission:
import collections

N = int(input())
a_list = list(map(int, input().split()))

count_a = collections.Counter(a_list)

for i in range(1, N+1):
    print(count_a[i])
Buggy python submission (verdict: Time Limit Exceeded):
import scipy as sp
import numpy as np
import math
 
 
N = int(input())
 
ans = 0
for a in range(1, N+1):
    for b in range(1, N+1):
        d = sp.gcd(a, b)
        for c in range(1, N+1):
 
            ans += sp.gcd(c, d)
 
print(ans)

Fixed submission:
import scipy as sp
import numpy as np
import math


N = int(input())

ans = 0
for a in range(1, N+1):
    for b in range(1, N+1):
        d = math.gcd(a, b)
        for c in range(1, N+1):

            ans += math.gcd(c, d)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import scipy as sp
from itertools import  combinations_with_replacement as com

def tri_gcd(a, b, c):
    return sp.gcd(a,  sp.gcd(b, c))


N = int(input())
ans = 0
duplication = 1
for a,b,c in com(range(1, N+1), 3):
    if len(set([a,b,c])) == 3:
        duplication = 6
    if len(set([a,b,c])) == 2:
        duplication = 3
    if len(set([a,b,c])) == 1:
        duplication = 1
    ans += duplication * tri_gcd(a, b, c)

print(ans)

Fixed submission:
import scipy as sp
import numpy as np
import math


N = int(input())

ans = 0
for a in range(1, N+1):
    for b in range(1, N+1):
        d = math.gcd(a, b)
        for c in range(1, N+1):

            ans += math.gcd(c, d)

print(ans)
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
taste = sp.arange(L, L+N)
s = sum(taste)

if 0 <= L:
    print(s - taste[0])
elif L+N < 1:
    print(s - taste[N-1])
else:
    print(s)

Fixed submission:
import scipy as sp

N, L = map(int, input().split())
taste = sp.arange(L, L+N)
s = sum(taste)

if 0 <= L:
    print(s - taste[0])
elif L+N < 1:
    print(s - taste[N-1])
else:
    print(s)
Buggy python submission (verdict: Runtime Error):
import math
a1, b, c, d = map(int, input().split())
a = a1 - 1
Sa =  a - a//c - a//d + a//(c*d/math.gcd(c, d))
Sb =  b - b//c - b//d + b//(c*d/math.gcd(c, d))
print(int(Sb - Sa))

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a


a1, b, c, d = map(int, input().split())
a = a1 - 1
Sa = a - a//c - a//d + a//(c*d//gcd(c, d))
Sb = b - b//c - b//d + b//(c*d//gcd(c, d))
print(int(Sb - Sa))

Buggy python submission (verdict: Runtime Error):
import math
a1, b, c, d = map(int, input().split())
a = a1 - 1
Sa =  a - a//c - a//d + a//(c*d/math.gcd(c, d))
Sb =  b - b//c - b//d + b//(c*d/math.gcd(c, d))
print(int(Sb - Sa))

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a


a1, b, c, d = map(int, input().split())
a = a1 - 1
Sa = a - a//c - a//d + a//(c*d//gcd(c, d))
Sb = b - b//c - b//d + b//(c*d//gcd(c, d))
print(int(Sb - Sa))
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = []
for i in range(N):
    l.append(list(map(int, input().split())))
    
l = sp.array(sorted(l, key=lambda x: x[1]))

a = sp.cumsum(l[:,0])
b = l[:,1]

c = b-a
t = True
for i in c:
    if i < 0:
        t = False
        print("No")

if t:
    print("Yes")

Fixed submission:
import scipy as sp
N = int(input())
l = []
for i in range(N):
    l.append(list(map(int, input().split())))

l = sp.array(sorted(l, key=lambda x: x[1]))

a = sp.cumsum(l[:,0])
b = l[:,1]

c = b-a
t = True
for i in c:
    if i < 0:
        t = False
        print("No")
        break

if t:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
N, Q = map(int, input().split())
string = input()
 
counter = [0]*N

for i in range(Q):
    counter[i+1] = counter[i]
    if string[i:i+2] == "AC":
        counter[i+1] += 1
        
for i in range(Q):
    l, r = map(int, input().split())
    print(counter[l-1] - counter[r-1])

Fixed submission:
N, Q = map(int, input().split())
string = input()
 
counter = [0]*(N+1)

for i in range(N):
    counter[i+1] = counter[i] + (1 if string[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(counter[r-1] - counter[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
string = input()
 
for i in range(Q):
    l, r = map(int, input().split())
    ans = string[l-1:r].count("AC")
    print(ans)

Fixed submission:
N, Q = map(int, input().split())
string = input()
 
counter = [0]*(N+1)

for i in range(N):
    counter[i+1] = counter[i] + (1 if string[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(counter[r-1] - counter[l-1])

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

for i in range(Q):
    l, r = map(int, input().split())
    print(string[l-1:r].count("AC"))


Fixed submission:
N, Q = map(int, input().split())
string = input()
 
counter = [0]*(N+1)

for i in range(N):
    counter[i+1] = counter[i] + (1 if string[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(counter[r-1] - counter[l-1])
Buggy python submission (verdict: Runtime Error):
count = 0

N = int(input())
S = input()
for j in range(1,N+1):
    for string in itertools.combinations(S, r = j):
        if len(set(string)) == len(string):
            print(string)
            count += 1


print(count)

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

n = 10**9 + 7
for i in set(S):
    counter *= (S.count(i)+1)
    counter = counter % n
 
print(counter-1)
Buggy python submission (verdict: Runtime Error):
total_cost = 0

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

AB_list = []
for i in range(N):
    AB_list.append((list(map(int, input().split()))))

AB_list = sorted(AB_list)

for i in range(N):
    if AB_list[i][1]<M:
        M = M - AB_list[i][1]
        total_cost =  total_cost + AB_list[i][0] * AB_list[i][1]
    else:
        total_cost = total_cost + M * AB_list[i][0]
        break
print(total_cost)


Fixed submission:

H, W = map(int, input().split())
h, w = map(int, input().split())

print((H-h)*(W-w))

Buggy python submission (verdict: Runtime Error):

total_cost = 0

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

AB_list = []
for i in range(N):
    AB_list.append((list(map(int, input().split()))))

AB_list.sort()

for i in range(N):
    if AB_list[i][1]<M:
        M = M - AB_list[i][1]
        total_cost =  total_cost + AB_list[i][0] * AB_list[i][1]
    else:
        total_cost = total_cost + M * AB_list[i][0]
        break
print(total_cost)


Fixed submission:

H, W = map(int, input().split())
h, w = map(int, input().split())

print((H-h)*(W-w))
Buggy python submission (verdict: Time Limit Exceeded):
import scipy as sp

total_cost = 0

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

AB_list = sp.array([0,0])
for i in range(N):
    AB_list = sp.vstack([AB_list, sp.array(list(map(int, input().split())))])


AB = AB_list[AB_list[:,0].argsort(), :]

A_list = AB[:,0]
B_list = AB[:,1]
for i in range(N+1):
    if B_list[i]<M:
        M = M - B_list[i]
        total_cost =  total_cost + A_list[i] * B_list[i]
       # print(i,M)
    else:
        total_cost = total_cost + M * A_list[i]
        break
print(total_cost)


Fixed submission:
total_cost = 0

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

AB_list = []
for i in range(N):
    AB_list.append((list(map(int, input().split()))))

AB_list = sorted(AB_list)

for i in range(N):
    if AB_list[i][1]<M:
        M = M - AB_list[i][1]
        total_cost =  total_cost + AB_list[i][0]*AB_list[i][1]
    else:
        total_cost = total_cost + M * AB_list[i][0]
        break
print(total_cost)

Buggy python submission (verdict: Runtime Error):
import scipy as sp

total_cost = 0

N, M = (map(int, input().split()))
A = sp.array(list(map(int, input().split())))
B = sp.array(list(map(int, input().split())))

AB_list = sp.stack([A, B]).T

AB = AB_list[:, AB_list[0,:].argsort()]

A_list = AB[0,:]
B_list = AB[1,:]
for i in range(N):
    if B_list[i]<M:
        M -= B_list[i]
        total_cost += A_list[i] * B_list[i]
    else:
        total_cost += M * A_list[i]
print(total_cost)


Fixed submission:
total_cost = 0

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

AB_list = []
for i in range(N):
    AB_list.append((list(map(int, input().split()))))

AB_list = sorted(AB_list)

for i in range(N):
    if AB_list[i][1]<M:
        M = M - AB_list[i][1]
        total_cost =  total_cost + AB_list[i][0]*AB_list[i][1]
    else:
        total_cost = total_cost + M * AB_list[i][0]
        break
print(total_cost)
Buggy python submission (verdict: Runtime Error):
import scipy as sp


def divisor(num):
    list = set()
    for i in sp.arange(1, num+1):
        if num % i == 0:
            list.add(i)
    return list


a, b, k = [int(i) for i in input().split()]

div_a = divisor(a)
div_b = divisor(b)

cd = sp.sort(list(div_a & div_b))
cd_r = cd[::-1]
print(cd_r[k-1])


Fixed submission:
a, b, c = [int(i) for i in input().split()]

if b//a > c:
    print(c)
else:
    print(b//a)
Buggy python submission (verdict: Runtime Error):
import scipy as sp

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

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

tree.sort()

print(min(tree[N-K+i] - tree[i] for i in range(N-K+1)))
    

Fixed submission:
N = int(input())

string = ["Christmas", "Eve", "Eve", "Eve"]
ans = []

for i in range(26-N):
    ans.append(string.pop(0))
print(" ".join(ans))
Buggy python submission (verdict: Runtime Error):
import scipy as sp

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

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

tree.sort()

print(min(tree[N-K+i] - tree[i] for i in range(N-K+1)))
    

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

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

tree.sort()

print(min(tree[i+K-1] - tree[i] for i in range(N-K+1)))

Buggy python submission (verdict: Time Limit Exceeded):
import scipy as sp

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

tree = sp.array([], dtype = "int")
for i in range(N):
    tree = sp.append(tree, int(input()))

tree.sort()

min_of_sub = 0
print(min(tree[N-K+i] - tree[i] for i in range(N-K+1)))
    

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

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

tree.sort()

print(min(tree[i+K-1] - tree[i] for i in range(N-K+1)))

Buggy python submission (verdict: Time Limit Exceeded):
import scipy as sp

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

tree = sp.array([], dtype = "int")
for i in range(N):
    tree = sp.append(tree, int(input()))

tree.sort()

print(int(min(tree[K-1:]-tree[:N-K+1])))


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

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

tree.sort()

print(min(tree[i+K-1] - tree[i] for i in range(N-K+1)))