Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys

N = int(sys.stdin.readline())
TA = []
for i in range(N):
    TA.append(list(map(int, sys.stdin.readline().split())))

current_T = 0
current_A = 0
for i in range(N):
    if i == 0:
        current_T = TA[i][0]
        current_A = TA[i][1]
        continue
    escape_flag = 0
    temp_T = math.floor(current_T / TA[i][0])
    temp_A = math.floor(current_A / TA[i][1])
    count = min([temp_T, temp_A])
    while escape_flag == 0:
        if TA[i][0] * count >= current_T and TA[i][1] * count >= current_A:
            escape_flag =1
        else:
            count += 1
    current_T = TA[i][0] * count
    current_A = TA[i][1] * count

print(current_T+ current_A)


Fixed submission:
import math
import sys
from decimal import Decimal


N = int(sys.stdin.readline())
TA = []
for i in range(N):
    TA.append(list(map(int, sys.stdin.readline().split())))

current_T = 1
current_A = 1
for i in range(N):
    count = max(math.ceil(Decimal(current_T)/Decimal(TA[i][0])), math.ceil(Decimal(current_A)/Decimal(TA[i][1])))
    current_T = TA[i][0] * count
    current_A = TA[i][1] * count

print(current_T + current_A)

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

N = int(sys.stdin.readline())
TA = []
for i in range(N):
    TA.append(list(map(int, sys.stdin.readline().split())))

current_T = 0
current_A = 0
for i in range(N):
    if i == 0:
        current_T = TA[i][0]
        current_A = TA[i][1]
        continue
    escape_flag = 0
    count = 1
    while escape_flag == 0:
        if TA[i][0] * count >= current_T and TA[i][1] * count >= current_A:
            escape_flag =1
        else:
            count += 1
    current_T = TA[i][0] * count
    current_A = TA[i][1] * count

print(current_T+ current_A)


Fixed submission:
import math
import sys
from decimal import Decimal


N = int(sys.stdin.readline())
TA = []
for i in range(N):
    TA.append(list(map(int, sys.stdin.readline().split())))

current_T = 1
current_A = 1
for i in range(N):
    count = max(math.ceil(Decimal(current_T)/Decimal(TA[i][0])), math.ceil(Decimal(current_A)/Decimal(TA[i][1])))
    current_T = TA[i][0] * count
    current_A = TA[i][1] * count

print(current_T + current_A)
Buggy python submission (verdict: Runtime Error):
S = input().strip()
s = str.lower(S)
target = 'hi'
if target = 'hi':
    print('Yes')
elif target = 'hihi':
    print('Yes')
elif target = 'hihihi':
    print('Yes')    
elif target = 'hihihihi':
    print('Yes')
elif target = 'hihihihihi':
    print('Yes')
else
    print('No')

Fixed submission:
S = input().strip()
target = S
if target == 'hi':
    print('Yes')
elif target == 'hihi':
    print('Yes')
elif target == 'hihihi':
    print('Yes')    
elif target == 'hihihihi':
    print('Yes')
elif target == 'hihihihihi':
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys

N, M = map(int,input().split())
a_lists = []

if N == 1:
    if M == 0:
        print (1)
        sys.exit()
    else:
        print(0)
        sys.exit()

for m in range (M):
    temp = int(input())
    a_lists.append(temp-1)
    
datas = [0]*N
if 0 in a_lists:
    datas[0] = 0
else:
    datas[0]=1

if 1 in a_lists:
    datas[1] = 0
else:
    datas[1]= datas[0]+1
    
for i in range (2,N):
    if i in a_lists:
        datas[i] =0
    else:
        datas[i] = datas[i-1] + datas[i -2]

print(datas[-1]%1000000007)

Fixed submission:
import sys
import heapq

N, M = map(int,input().split())
a_lists = []

if N == 1:
    if M == 0:
        print (1)
        sys.exit()
    else:
        print(0)
        sys.exit()

for m in range (M):
    temp = int(input())
    a_lists.append(temp-1)

a_lists.append(10**6)

datas = [0]*N
if 0 in a_lists:
    datas[0] = 0
    heapq.heappop(a_lists) 
    
else:
    datas[0]=1

if 1 in a_lists:
    datas[1] = 0
    heapq.heappop(a_lists) 
else:
    datas[1]= datas[0]+1
    
heapq.heapify(a_lists)
    
for i in range (2,N):
    if i == a_lists[0]:
        datas[i] =0
        heapq.heappop(a_lists) 
    else:
        datas[i] = datas[i-1] + datas[i -2]

print(datas[-1]%1000000007)

Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
a_lists = []
for m in range (M):
    temp = int(input())
    a_lists.append(temp-1)
    
datas = [0]*N
if 0 in a_lists:
    datas[0] = 0
else:
    datas[0]=1

if 1 in a_lists:
    datas[1] = 0
else:
    datas[1]= datas[0]+1
for i in range (2,N):
    if i in a_lists:
        datas[i] =0
    else:
        datas[i] = datas[i-1] + datas[i -2]

print(datas[-1]%1000000007)

Fixed submission:
import sys
import heapq

N, M = map(int,input().split())
a_lists = []

if N == 1:
    if M == 0:
        print (1)
        sys.exit()
    else:
        print(0)
        sys.exit()

for m in range (M):
    temp = int(input())
    a_lists.append(temp-1)

a_lists.append(10**6)

datas = [0]*N
if 0 in a_lists:
    datas[0] = 0
    heapq.heappop(a_lists) 
    
else:
    datas[0]=1

if 1 in a_lists:
    datas[1] = 0
    heapq.heappop(a_lists) 
else:
    datas[1]= datas[0]+1
    
heapq.heapify(a_lists)
    
for i in range (2,N):
    if i == a_lists[0]:
        datas[i] =0
        heapq.heappop(a_lists) 
    else:
        datas[i] = datas[i-1] + datas[i -2]

print(datas[-1]%1000000007)
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int,input().split())
count = 0
i_range = N//R+1
j_range = N//G+1

for i in range (i_range):
    for j in range (j_range):
        if (N - i*R - j*G)%B == 0 and (N - i*R - j*G)>=0:
            count += 1
print(count)


Fixed submission:
R, G, B, N = map(int,input().split())
count = 0
i_range = N//R+1
j_range = N//G+1

for i in range (N//R+1):
    for j in range (N//G+1):
        if (N - i*R - j*G)%B == 0 and (N - i*R - j*G)>=0:
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int,input().split())
count = 0
for i in range (N//R+1):
    for j in range (N//G+1):
        if (N - i*R - j*G)%B == 0 and (N - i*R - j*G)>=0:
            count += 1
print(count)

Fixed submission:
R, G, B, N = map(int,input().split())
count = 0
i_range = N//R+1
j_range = N//G+1

for i in range (N//R+1):
    for j in range (N//G+1):
        if (N - i*R - j*G)%B == 0 and (N - i*R - j*G)>=0:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())

sum = 0
for i in range (1,N+1):
    if N//i == N%i:
        sum += i
array.append(sum)
print(sum)

Fixed submission:
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

divisors = make_divisors(N)

count = 0
for divisor in divisors:
    m = divisor-1
    if m and (N//m == N%m):
        count += m
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
first_black = 0
count = 0
for i in range (N):
    if first_black == 0 and S[i]=='#':
        first_black = 1
    if first_black == 1 and S[i]== '.':
        count +=1
        
first_white = 0
white_count = 0
for i in range (N):
    if first_white == 0 and S[N-i-1]=='.':
        first_white = 1
    if first_white == 1 and S[N-i-1]== '#':
        white_count +=1

white_black = 10**6
for i in range (N):
    temp = S[:i].count('#') + S[i:].count('.')
    if temp<= white_black:
        white_black = temp
        
print(min(count,white_count,white_black))

Fixed submission:
N = int(input())
S = input()
first_black = 0
count = 0
for i in range (N):
    if first_black == 0 and S[i]=='#':
        first_black = 1
    if first_black == 1 and S[i]== '.':
        count +=1
        
first_white = 0
white_count = 0
for i in range (N):
    if first_white == 0 and S[N-i-1]=='.':
        first_white = 1
    if first_white == 1 and S[N-i-1]== '#':
        white_count +=1

white_black = 10**6

black_count_left = 0
white_count_right = S.count('.')
ans = black_count_left + white_count_right

for i in range (N):
    if S[i] == '#':
        black_count_left+=1
    elif S[i] == '.':
        white_count_right-=1
    if ans >= black_count_left+white_count_right:
        ans = black_count_left+white_count_right
        
print(min(count,white_count, ans))
Buggy python submission (verdict: Runtime Error):
A = input()
if A = 'A':
    print ('T')
elif A = 'T':
    print ('A')
elif A = 'G':
    print ('C')
else:
    print('G')

Fixed submission:
A = input()
if A == 'A':
    print ('T')
elif A == 'T':
    print ('A')
elif A == 'G':
    print ('C')
else:
    print('G')
Buggy python submission (verdict: Runtime Error):
S = input()

max_count = 0
count = 0
for i in range(len(S)):
    if S[i] in atgc:
        count+=1
    else:
        max_count = max(max_count,count)
        count = 0
print(max_count)

Fixed submission:
S = input()

atgc = ['A','T','G','C']

max_count = 0
count = 0
for i in range(len(S)):
    if S[i] in atgc:
        count+=1
    else:
        max_count = max(max_count,count)
        count = 0
max_count = max(max_count,count)
print(max_count)
Buggy python submission (verdict: Runtime Error):
N, Q = map(int,input().split())
S = input()

atgc_list= []

flag = 0
memo =0

for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    elif flag == 1 and S[i] == 'C':
        memo+=1
    elif S[i] in ['T','G','C']:
        flag = 0
    atgc_list.append(memo)
        
atgc_list_np = np.array(atgc_list)

for j in range (Q):
    l, r = map(int,input().split())
    low = atgc_list[l-1]
    high = atgc_list[r-1]
    print(high - low)


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

atgc_list= []

flag = 0
memo =0

for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    elif flag == 1 and S[i] == 'C':
        memo+=1
        flag = 0
    elif S[i] in ['T','G','C']:
        flag = 0
    atgc_list.append(memo)
        

for j in range (Q):
    l, r = map(int,input().split())
    low = atgc_list[l-1]
    high = atgc_list[r-1]
    print(high - low)

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

atgc_list= []

flag = 0
memo =0

for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    if flag == 1 and S[i] == 'C':
        memo+=1
    if S[i] in ['T','G']:
        flag = 0
    atgc_list.append(memo)
        
atgc_list_np = np.array(atgc_list)

for j in range (Q):
    l, r = map(int,input().split())
    low = atgc_list[l-1]
    high = atgc_list[r-1]
    print(high - low)

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

atgc_list= []

flag = 0
memo =0

for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    elif flag == 1 and S[i] == 'C':
        memo+=1
        flag = 0
    elif S[i] in ['T','G','C']:
        flag = 0
    atgc_list.append(memo)
        

for j in range (Q):
    l, r = map(int,input().split())
    low = atgc_list[l-1]
    high = atgc_list[r-1]
    print(high - low)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, Q = map(int,input().split())
S = input()

atgc_list= []

flag = 0
for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    if flag == 1 and S[i] == 'C':
        atgc_list.append(i)
    if S[i] in ['T','G']:
        flag = 0
        
atgc_list_np = np.array(atgc_list)

for j in range (Q):
    l, r = map(int,input().split())
    low = np.sum(l>(atgc_list_np))
    high = np.sum(r>(atgc_list_np))
    print(high - low)




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

atgc_list= []

flag = 0
memo =0

for i in range (len(S)):
    if S[i]=='A':
        flag = 1
    elif flag == 1 and S[i] == 'C':
        memo+=1
        flag = 0
    elif S[i] in ['T','G','C']:
        flag = 0
    atgc_list.append(memo)
        

for j in range (Q):
    l, r = map(int,input().split())
    low = atgc_list[l-1]
    high = atgc_list[r-1]
    print(high - low)
Buggy python submission (verdict: Runtime Error):
import numpy as np

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

B = list(map(int,input().split()))

count = 0
for i in range (N):
    A = list(map(int,input().split()))
    if np.array(A)*np.array(B) > 0:
        count += 1
print(count)

Fixed submission:
import numpy as np
 
N, M, C = map(int,input().split())
 
B = list(map(int,input().split()))
 
count = 0
for i in range (N):
    A = list(map(int,input().split()))
    if np.sum(np.array(A)*np.array(B)) + C> 0:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
A, B = map(int,input().split())
A_non_zero = 0
B_non_zero = 0
if A%2==1:
    A_non_zero = A
    A +=1
if B%2!=1:
    B_non_zero =B
    B -=1

count = 0
for i in range (A,B+1):
    if i%2==1:
        count +=1
        
result =bin(A_non_zero^B_non_zero^count%2)
print(int(result,2))

Fixed submission:
A, B = map(int,input().split())
A_non_zero = 0
B_non_zero = 0
if A%2==1:
    A_non_zero = A
    A +=1
if B%2!=1:
    B_non_zero =B
else:
    B +=1
count = (B-A)//2
result =bin(A_non_zero^B_non_zero^count%2)
print(int(result,2))
Buggy python submission (verdict: Runtime Error):
import math
N =int(input())
M = list(map(int,input().split()))

gcd_result=M[0]
for i in range (N-1):
    before = math.gcd(gcd_result,M[i+1])
    gcd_result=before
print(gcd_result)

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

gcd_result=M[0]
for i in range (N-1):
    before = fractions.gcd(gcd_result,M[i+1])
    gcd_result=before
print(gcd_result)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, K = map(int,input().split())
A = list(map(int,input().split()))
zero_padding = len(bin(max(A))[2:])
add = np.array([0]*zero_padding)
for i in range(len(A)):
    n = i
    n =bin(n)[2:]
    num = list(map(int, str(n)))
    num = [0]*(zero_padding-len(n)) +num
    add = add + np.array(num)
result = [1]*len(bin(9)[2:])
length = min(len(result),len(add))
for j in range (1,length+1):
    if add[-j] <= N//2:
        result[-j] =0 
best = int(''.join(map(str, result)),2)
ans = 0
for i in range (len(A)):
    ans +=int(bin(best ^ A[i]),2)
print(ans)


Fixed submission:
T, X = map(int,input().split())
print(T/X)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
N, M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()

X_list = list(np.diff(X))

if M-N < 1:
    print(0)
    sys.exit()

for _ in range(N-1):
    X_list.remove(max(X_list))
    
print(sum(X_list))

Fixed submission:
import numpy as np
import sys
N, M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()

X_list = list(np.diff(X))

if M-N < 1:
    print(0)
    sys.exit()

X_list.sort(reverse=True)
print(sum(X_list[N-1:]))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
N, M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()

X_list = []
for i in range (len(X)-1):
    X_list.append(X[i+1]-X[i])

if M-N < 1:
    print(0)
    sys.exit()

for _ in range(N-1):
    X_list.remove(max(X_list))
    
print(sum(X_list))

Fixed submission:
import numpy as np
import sys
N, M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()

X_list = list(np.diff(X))

if M-N < 1:
    print(0)
    sys.exit()

X_list.sort(reverse=True)
print(sum(X_list[N-1:]))
Buggy python submission (verdict: Runtime Error):
N, K= map(int,input().split())
h = list(map(int,input().split()))

dp = [0] * N
h = np.array(h)

dp = np.array([0]*N, dtype=np.int64)

for i in range (1, N):
    x = max(0, i - K)
    dp[i] = np.min(dp[x:i] + np.abs(h[i]-h[x:i]))
print(dp[N-1])

Fixed submission:
import numpy as np
N, K= map(int,input().split())
h = list(map(int,input().split()))
 
dp = [0] * N
h = np.array(h)
 
dp = np.array([0]*N, dtype=np.int64)
 
for i in range (1, N):
    x = max(0, i - K)
    dp[i] = np.min(dp[x:i] + np.abs(h[i]-h[x:i]))
print(dp[N-1])

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

dp = [0] * N
dp [0] = 0

for j in range (1, N):
    dp_cost = dp[j-1] + abs(h[j]-h[j-1])
    for k in range (2, K+1- max(0,K-j)):
        dp_cost = min(dp_cost, dp[j-k] + abs(h[j]-h[j-k]))
    dp[j] = dp_cost
print(dp[N-1])

Fixed submission:
import numpy as np
N, K= map(int,input().split())
h = list(map(int,input().split()))
 
dp = [0] * N
h = np.array(h)
 
dp = np.array([0]*N, dtype=np.int64)
 
for i in range (1, N):
    x = max(0, i - K)
    dp[i] = np.min(dp[x:i] + np.abs(h[i]-h[x:i]))
print(dp[N-1])

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

dp = [0] * N
dp [0] = 0

for j in range (1, N):
    dp_list = []
    for k in range (1, K+1- max(0,K-j)):
        dp_list.append(dp[j-k] + abs(h[j]-h[j-k]))
    dp[j] = min(dp_list)
print(dp[N-1])

Fixed submission:
import numpy as np
N, K= map(int,input().split())
h = list(map(int,input().split()))
 
dp = [0] * N
h = np.array(h)
 
dp = np.array([0]*N, dtype=np.int64)
 
for i in range (1, N):
    x = max(0, i - K)
    dp[i] = np.min(dp[x:i] + np.abs(h[i]-h[x:i]))
print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0
p_max = 0
for i in range(N):
    p = int(input())
    if p > p_min:
        print
        p_min = p
    ans+=p
print(ans-p_min//2)

Fixed submission:
N = int(input())
ans = 0
p_max = 0
for i in range(N):
    p = int(input())
    if p > p_max:
        print
        p_max = p
    ans+=p
print(ans-p_max//2)
Buggy python submission (verdict: Runtime Error):
N, M =map(int,input().split())
ans=1
for i in range (1,M//N):
    if M%i==0:
        if M//i>=N:
            ans=i
print(ans)

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,B=map(int,input().split())
for i in range (1,4):
    if A*B*i==3:
        print("Yes")
        sys.exit()
print("No")

Fixed submission:
import sys
A,B=map(int,input().split())
for i in range (1,4):
    if (A*B*i)%2==1:
        print("Yes")
        sys.exit()
print("No")
Buggy python submission (verdict: Runtime Error):
N, X =map(int,input().split())
x = list(map(int,input().split()))
result = abs(abs(np.array(x))-X)
import fractions
D= result[0]
for i in range (1,len(result)):
    D=fractions.gcd(D,result[i])
print(D)

Fixed submission:
import numpy as np
import fractions

N, X =map(int,input().split())
x = list(map(int,input().split()))
result = abs(abs(np.array(x))-X)

D= result[0]
for i in range (1,len(result)):
    D=fractions.gcd(D,result[i])
print(D)
Buggy python submission (verdict: Runtime Error):
import sys
N,K=map(int,input().split())
a=list(map(int,input().split()))

minus=[]
for i in range (N):
    if a[i]<0:
        minus.append(a[i])
plus=a[len(minus):]

if len(minus)==0:
    print(plus[K-1])
    sys.exit()
if len(plus)==0:
    minus=minus[::-1]
    print(minus[K-1])
    sys.exit()

if K==1:
    minus=minus[::-1]
    if len(plus)==0:
        plus.append(10**18)
    if len(minus)==0:
        minus.append(10**18)
    print(min(plus[0],abs(minus[0])))
    sys.exit()
     
data=[i * 2 for i in minus]+plus
data2=minus+[i * 2 for i in plus]
data_min=10**18
for i in range (N-K+1):
    if data_min >((abs(min(data[i],0)))+((abs(min(data[i+K-1],0))):
        data_min=((abs(min(data[i],0)))+((abs(min(data[i+K-1],0)))
for i in range (N-K+1):
    if data_min >((abs(min(data2[i],0)))+((abs(min(data2[i+K-1],0))):
        data_min=((abs(min(data2[i],0)))+((abs(min(data2[i+K-1],0)))
print(data_min)

Fixed submission:
import numpy as np
N, K = map(int,input().split())
x = list(map(int,input().split()))

ans = 10**9
for i in range (N-K+1):
    front = np.array(x[i])
    end   = np.array(x[i+K-1])
    
    if np.sign(front)!= np.sign(end):
        ans_temp = min (abs(front)*2+abs(end),abs(front)+abs(end)*2)
    else:
        ans_temp = max(abs(front),abs(end))
    
    if ans_temp <= ans:
        ans = ans_temp
print(ans)
Buggy python submission (verdict: Runtime Error):
S=input()
count=0
for i in range (len(S)):
    count+=int(S[i])
 
if int(S)%count==0:
    print ("Yes")
else:
    print ("No")

Fixed submission:
S=input()
count=0
for i in range (len(S)):
    if S[i]=="+":
        count+=1
    else:
        count-=1
print(count)
Buggy python submission (verdict: Runtime Error):
A,B,C,X,Y=map(int,input().split())

total_price=0
C2=C*2

if C2<=A and C2<=B:
    total_price=C2*max(X,Y)

elif C2<=(A+B):
    if X>=Y:
        total_price=C2*Y
        X=X-Y
        Y=0
        total_price=total_price+A*X
    else:
        total_price=C2*X
        X=0
        Y=Y-X
        total_price=total_price+B*Y
        
else:
    total_price=A*X+B*Y
print(total_price)

Fixed submission:
a = (input())
count=0
for i in range (3):
    if a[i]=='o':
        count+=1

output=700+100*count
print(output)
Buggy python submission (verdict: Runtime Error):
total_price=0
C2=C*2

if C2<=A and C2<=B:
    total_price=C2*max(X,Y)
        
elif (C2>=A and C2<=B):
    total_price=C2*min(X,Y)
    total_price=total_price+B*(Y-X)      
    print(total_price)
    
elif (C2<=A and C2>=B) :
    total_price=C2*min(X,Y)
    total_price=total_price+A*(X-Y)      
    print(total_price)

elif C2<=(A+B):  #C2<=(A+B): 
    if X>=Y:
        total_price=C2*Y
        X=X-Y
        Y=0
        total_price=total_price+A*X
    else:
        total_price=C2*X
        X=0
        Y=Y-X
        total_price=total_price+B*Y
        
else:
    total_price=A*X+B*Y
print(total_price)

Fixed submission:
A, B, C, X, Y = map(int,input().split())
pattern1 = X*A + Y *B
pattern2 = X*(C*2) + B*(max(0,Y-X))
pattern3 = A*(max(0,X-Y)) + Y*(C*2)
print(min(pattern1,pattern2,pattern3))

Buggy python submission (verdict: Runtime Error):
total_price=0
C2=C*2

if C2<=A and C2<=B:
    total_price=C2*max(X,Y)

elif C2<=(A+B):
    if X>=Y:
        total_price=C2*Y
        X=X-Y
        Y=0
        total_price=total_price+A*X
    else:
        total_price=C2*X
        X=0
        Y=Y-X
        total_price=total_price+B*Y
        
else:
    total_price=A*X+B*Y
print(total_price)


Fixed submission:
A, B, C, X, Y = map(int,input().split())
pattern1 = X*A + Y *B
pattern2 = X*(C*2) + B*(max(0,Y-X))
pattern3 = A*(max(0,X-Y)) + Y*(C*2)
print(min(pattern1,pattern2,pattern3))
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int, input().split()))

import copy
X_sort=copy.deepcopy(X)
X_sort.sort()
X_sort

median_control=(X_sort[N//2-1]+X_sort[N//2])/2
for i in range (N):
    if X[i]>median_control:
        print (X_sort[N//2-1])
    if X[i]<=median_control:
        print (X_sort[N//2])



Fixed submission:
A, B, X = map(int, input().split())
if X>=A and X<= A+B:
    print ("YES")
else:
    print ("NO")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for i in N:
	abs=abs(A-)

D,X =  map(int, input().split())
N_chocolate=0
for i in range (N):
	A= int(input())
	if A == 1:
		N_chocolate=N_chocolate+D-1
	else:
		N_chocolate=N_chocolate+int(D/A)
output=N_chocolate+X+N
print (output)

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

A_before=0
full_price=0
for i in range (N):
    full_price=full_price+abs(A[i]-A_before)
    A_before=A[i]
full_price=full_price+abs(A[N-1])

total_price=0
#No.1
negative=abs(A[0]-0)+ abs(A[1]-A[0])-abs(A[1]-(0))
total_price=full_price-negative
print(total_price)

for j in range (1,N-1):
    negative=abs(A[j]-A[j-1])+ abs(A[j+1]-A[j])-abs(A[j+1]-(A[j-1]))
    total_price=full_price-negative
    print(total_price)
    
#No.Last
negative=abs(0-A[N-1])+ abs(A[N-1]-A[N-2])-abs(0-A[N-2]) 
total_price=full_price-negative
print(total_price)
Buggy python submission (verdict: Runtime Error):
if A+B>=C:
    print ("Yes")
else:
    print ("No")

Fixed submission:
A, B, C = map(int, input().split())
if A+B>=C:
    print ("Yes")
else:
    print ("No")