Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = collections.Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))

Fixed submission:
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))

Buggy python submission (verdict: Runtime Error):
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = collections.Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))

Fixed submission:
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))

Buggy python submission (verdict: Time Limit Exceeded):
import collections
S = []
ans = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)
c = collections.Counter(S)
j = 0
while c.most_common()[j][1]==c.most_common()[0][1] and j<len(collections.Counter(S)):
    if j==len(collections.Counter(S))-1:
        ans.append(c.most_common()[j][0])
        break
    ans.append(c.most_common()[j][0])
    j+=1
ans = sorted(ans)
for i in range(len(ans)):
  print(ans[i])

Fixed submission:
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))
Buggy python submission (verdict: Runtime Error):
import math
H = int(input())
A = math.floor(math.log2(H))
print(2**(A+1)-1)

Fixed submission:
import math
H = int(input())
A = math.floor(math.log2(H))
print(2**(A+1)-1)
Buggy python submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print(int(A*B/math.gcd(A,B)))



Fixed submission:
from fractions import gcd
A, B = map(int, input().split())
print(int(A*B//gcd(A,B)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = N*N
for i in range(1, N//2+1):
        if N%i==0:
            j = N//i
            if ans >= i+j-2:
                ans=i+j-2
print(ans)  

Fixed submission:
import math
N = int(input())
ans = N*N
for i in range(1,int(math.sqrt(N))+1):
        if N%i==0:
            j = N//i
            if ans >= i+j-2:
                ans=i+j-2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = sorted(list(map(int, input().split())))
n = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            if L[j]-L[i]<L[k]<L[i]+L[j]:
                n +=1
            else:
                break
print(n)

Fixed submission:
import bisect
 
n = int(input())
l = sorted(list(map(int, input().split())))
count = 0
 
for i in range(n):
    a = l[i]
    for j in range(i+1, n):
        b = l[j]
        ab = a + b
        index_c = bisect.bisect_left(l, ab)#二分探索,abをlの中のどこに挿入するか
        count += index_c - j -1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int, input().split()))
n = 0
for i in range(N):
    for j in range(N):
        for k in range(N):
            if i< j< k:
                if L[i-1]< L[j-1] + L[k-1] and L[j-1]< L[i-1] + L[k-1] and L[k-1]< L[j-1] + L[i-1]:
                    n +=1
print(n)

Fixed submission:
import bisect
 
n = int(input())
l = sorted(list(map(int, input().split())))
count = 0
 
for i in range(n):
    a = l[i]
    for j in range(i+1, n):
        b = l[j]
        ab = a + b
        index_c = bisect.bisect_left(l, ab)#二分探索,abをlの中のどこに挿入するか
        count += index_c - j -1

print(count)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
B = np.argsort(A)+1
print (' '.join(map(str,B)))

Fixed submission:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
B = np.argsort(A)+1
print (' '.join(map(str,B)))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
l = []
for i in range(1, N+1):
    a = A.index(i)
    l.append(a+1)
    
print(' '.join(map(str, l)))

Fixed submission:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
B = np.argsort(A)+1
print (' '.join(map(str,B)))
Buggy python submission (verdict: Runtime Error):
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
%matplotlib inline

#{1, 2, ..., n} の順列 p = {p1,p2, ..., pn } があります。
#以下の条件を満たすような pi (1<i<n) がいくつあるかを出力してください。
#pi−1, pi, pi+1 の 3 つの数の中で、pi が 2 番目に小さい。

n = int(input())
p = list(map(int, input().split()))
ans=0
for i in range(n-1):
    if p[i-1]<p[i]<p[i+1] or p[i+1]<p[i]<p[i-1] :
        ans+=1
    else:
        ans==ans
print(ans)
        

Fixed submission:
#{1, 2, ..., n} の順列 p = {p1,p2, ..., pn } があります。
#以下の条件を満たすような pi (1<i<n) がいくつあるかを出力してください。
#pi−1, pi, pi+1 の 3 つの数の中で、pi が 2 番目に小さい。

n = int(input())
p = list(map(int, input().split()))
ans=0
for i in range(1,n-1):
    if p[i-1]<=p[i]<p[i+1] or p[i+1]<=p[i]<p[i-1] :
        ans+=1

    else:
        ans==ans
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
b = 0

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

Fixed submission:
s = input()
b = 0

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):
#N  個のリンゴがあります。
#これらはそれぞれリンゴ 1、リンゴ 2、リンゴ 3、...、リンゴ N と呼ばれており、リンゴ i の「味」は L+i−1 です。
#「味」は負になることもありえます。
#また、1 個以上のリンゴを材料として、アップルパイをつくることができます。
#その「味」は、材料となったリンゴの「味」の総和となります。
#あなたはこれらのリンゴを全て材料として、アップルパイをつくる予定でしたが、おなかがすいたので 1 個だけ食べることにしました。
#勿論、食べてしまったリンゴはアップルパイの材料にはできません。
#つくる予定だったアップルパイとできるだけ同じものをつくりたいので、N 個のリンゴ全てを材料としてできるアップルパイの「味」と、食べていない N−1 個のリンゴを材料としてできるアップルパイの「味」の差の絶対値ができるだけ小さくなるように、食べるリンゴを選ぶことにしました。
#このようにして選ばれたリンゴを食べた時、食べていない N−1 個のリンゴを材料としてできるアップルパイの「味」を求めてください。
#なお、この値は一意に定まることが証明できます。

N, L = map(int, input().split())
A = [L+x for x in range(N)]

min_abs = abs(A[0])
ate = A[0]

for i in range(len(A)):
    if min_abs > abs(A[i]):
        min_abs = abs(A[i])
        ate = A[i]
        
print(sum(A)-eat)

Fixed submission:
#N  個のリンゴがあります。
#これらはそれぞれリンゴ 1、リンゴ 2、リンゴ 3、...、リンゴ N と呼ばれており、リンゴ i の「味」は L+i−1 です。
#「味」は負になることもありえます。
#また、1 個以上のリンゴを材料として、アップルパイをつくることができます。
#その「味」は、材料となったリンゴの「味」の総和となります。
#あなたはこれらのリンゴを全て材料として、アップルパイをつくる予定でしたが、おなかがすいたので 1 個だけ食べることにしました。
#勿論、食べてしまったリンゴはアップルパイの材料にはできません。
#つくる予定だったアップルパイとできるだけ同じものをつくりたいので、N 個のリンゴ全てを材料としてできるアップルパイの「味」と、食べていない N−1 個のリンゴを材料としてできるアップルパイの「味」の差の絶対値ができるだけ小さくなるように、食べるリンゴを選ぶことにしました。
#このようにして選ばれたリンゴを食べた時、食べていない N−1 個のリンゴを材料としてできるアップルパイの「味」を求めてください。
#なお、この値は一意に定まることが証明できます。

N, L = map(int, input().split())
A = [L+x for x in range(N)]

min_abs = abs(A[0])
ate = A[0]

for i in range(len(A)):
    if min_abs > abs(A[i]):
        min_abs = abs(A[i])
        ate = A[i]
        
print(sum(A)-ate)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
mod = 10**9 +7
dp = [0]*(N+1)
dp[0] = 1
if A[0]==1:
    dp[1]=0
else:
    dp[1]=1
for i in range(2, N+1):
    if i not in A:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[-1])

Fixed submission:
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
mod = 10**9 +7
dp = [0]*(N+1)
dp[:2]= 1, 1 if 1 not in A else 0
for i in range(2, N+1):
    if i not in A:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
mod = 10**9 +7
dp = [0]*(N+1)
dp[0] = 1
if A[0]!=1:
    dp[1]=1
for i in range(2, N+1):
    if i not in A:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[-1])

Fixed submission:
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
mod = 10**9 +7
dp = [0]*(N+1)
dp[:2]= 1, 1 if 1 not in A else 0
for i in range(2, N+1):
    if i not in A:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = []
for i in range(M):
    a = int(input())
    A.append(a)
mod = 10**9 +7
dp = [0]*(N+1)
dp[0] = 1
if 1 not in A:
    dp[1]=1
for i in range(2, N+1):
    if i not in A:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[-1])

Fixed submission:
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
mod = 10**9 +7
dp = [0]*(N+1)
dp[:2]= 1, 1 if 1 not in A else 0
for i in range(2, N+1):
    if i not in A:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
ans = 0
k = 1/N
for i in range(1, N+1):
    if K>i:
        print(math.ceil(math.log2(K/i)))
        ans +=(0.5)**math.ceil(math.log2(K/i))
        print(ans)
    else:
        ans +=1
print(k*ans)

Fixed submission:
import math
N, K = map(int, input().split())
ans = 0
k = 1/N
for i in range(1, N+1):
    if K>i:
        ans +=(0.5)**math.ceil(math.log2(K/i))
    else:
        ans +=1
print(k*ans)
Buggy python submission (verdict: Runtime Error):
import math
A, B, K = map(int, input().split())
num = math.gcd(A,B)
a = []
a.append(num)
for i in range(1,num):
    if num % i == 0:
        a.append(i)
b = sorted(a)
print(b[len(b)-K])

Fixed submission:
a,b,k=map(int,input().split())
li=[]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        li.append(i)
print(li[len(li)-k])

Buggy python submission (verdict: Runtime Error):
import math
A, B, K = map(int, input().split())
num = math.gcd(A,B)
a = [num]
for i in range(1,num):
    if num % i == 0:
        a.append(i)
b = sorted(a)
print(b[len(b)-K])

Fixed submission:
a,b,k=map(int,input().split())
li=[]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        li.append(i)
print(li[len(li)-k])

Buggy python submission (verdict: Runtime Error):
import math
A, B, K = map(int, input().split())
num = math.gcd(A,B)
a = [num]
for i in range(1,num):
    if num % i == 0:
        a.append(i)
b = sorted(a)
print(b[len(b)-K])

Fixed submission:
a,b,k=map(int,input().split())
li=[]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        li.append(i)
print(li[len(li)-k])

Buggy python submission (verdict: Runtime Error):
import math
A, B, K = map(int, input().split())
num = int(math.gcd(A,B))
a = [num]
for i in range(1,num):
    if num % i == 0:
        a.append(i)
b = sorted(a)
print(b[len(b)-K])

Fixed submission:
a,b,k=map(int,input().split())
li=[]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        li.append(i)
print(li[len(li)-k])
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
 
if S==T:
    ans="Yes"
else:
    ans="No"
    for _ in range(len(S)):
        rotated_S=S[len(S)-1:]+S[:len(S)-1]
        if rotated_S==T:
            ans="Yes"
            break
        else:
            S=rotated_S
print(ans)

Fixed submission:
A= list(map(int, input().split()))
B= sorted(A)
print(B[2]-B[0])

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
cnt = 0
s = S + S
for i in range(len(S)+1):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
if cnt==len(T) or S == T:
    print('Yes')
else:
    print('No')

Fixed submission:
A= list(map(int, input().split()))
B= sorted(A)
print(B[2]-B[0])

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
cnt = 0
s = S + S
for i in range(len(S)+1):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
if cnt==len(T) or S == T:
    print('Yes')
else:
    print('No')
                

Fixed submission:
A= list(map(int, input().split()))
B= sorted(A)
print(B[2]-B[0])
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(int(2*N / math.gcd(2, N)))

Fixed submission:
N = int(input())
if N%2==0:
    print(N)
else:
    print(N*2)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
print(int(2*N / math.gcd(2, N)))

Fixed submission:
N = int(input())
if N%2==0:
    print(N)
else:
    print(N*2)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())
for i in range(A,B+1):
    if A <=i < A+K or B-K < i <= B:
        print(i)

Fixed submission:
A, B, K = map(int, input().split())
s = set()

for i in range(A, min(A+K, B+1)):
    s.add(i)
for i in range(max(B-K+1,A), B+1):
    s.add(i)
S=list(sorted(s))
for i in range(len(S)):
    print(S[i])
Buggy python submission (verdict: Runtime Error):
import statistics
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]
for i in range(M):
    if t[i] in s:
        s.remove(t[i])
if s ==list():
    print(0)
else:
    print(s.count(statistics.mode(s)))

Fixed submission:
import collections
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]
for i in range(M):
    if t[i] in s:
        s.remove(t[i])
if s ==list():
    print(0)
else:
    print(s.count(collections.Counter(s).most_common()[0][0]))
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
x = False
Y = Y//1000
for i in range(N+1):
        for j in range(N-i+1):
                b = N - i
                c = N - i - j
                if a + b + c == N and Y == a*10 + b*5 +c:
                    x = True
                    break
        break
if x:
    print(a, b, c , sep=(' '))        
                    
else:
    print(-1, -1, -1, sep=(' '))

Fixed submission:
N, Y = map(int, input().split())
a = -1
b = -1
c = -1

Y = Y//1000
for i in range(N+1):
    for j in range(N-i+1):
        if Y == i*9 + j*4 +N:
            a = i
            b = j
            c = N-i-j
            #print(a,b,c)
            break
        else:
            continue
        break
        
          
print(a, b, c , sep=(' '))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
ans = []
for i in range(N):
    cnt = 0
    while A[i]%2==0:
        cnt+=1
    ans.append(cnt)

print(min(ans))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
cnt = 0
ans = []
for i in range(N):
    while A[i]%2==0:
        A[i] /=2
        cnt += 1
    ans.append(int(cnt))
    cnt = 0
        
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
A = np.prod(list(map(int, input().split())))
cnt = 0
while A%2==0:
    cnt+=1

print(int(cnt//N))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
cnt = 0
ans = []
for i in range(N):
    while A[i]%2==0:
        A[i] /=2
        cnt += 1
    ans.append(int(cnt))
    cnt = 0
        
print(min(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = []
for i in range(int(N/2)):
    if i**2<=N:
        L.append(i**2)
print(max(L))

Fixed submission:
import math
N=int(input())
n=math.sqrt(N)
 
print(int(n)**2)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
a = [1, 2, 4, 8, 16, 32, 64]
b = []
for i in range(len(a)):
    if a[i]<=N:
        b.append(a[i])
print(max(b))

Fixed submission:
N = int(input())
a = [1, 2, 4, 8, 16, 32, 64]
b = []
for i in range(len(a)):
    if a[i]<=N:
        b.append(a[i])
print(max(b))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = 1
for i in range(1,N+1):
    p = p*i
print(p%(10**9+7))

Fixed submission:
import math
N = int(input())
p = math.factorial(N)
print(int(p%(10**9+7)))
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i + j + k ==S:
                cnt += 1

print(cnt)

Fixed submission:
K,S = map(int,input().split())
a = 0
 
for y in range(K + 1):
     for z in range(K + 1):
        if 0 <= S - y - z <= K:
            a += 1
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    if i%x == 0:
        cnt+=1
print(cnt)

Fixed submission:
a, b, x = map(int, input().split())
print(b//x-(a-1)//x)
Buggy python submission (verdict: Runtime Error):
S = str(input())
T = str(input())

count = 0
for i in range(i, len(S)):
  if S[i] != T[i]:
    count+=1
    
print(count)

Fixed submission:
S = str(input())
T = str(input())
 
count = 0
for i in range(0, len(S)):
  if S[i] != T[i]:
    count+=1
    
print(count)
Buggy python submission (verdict: Runtime Error):
a, b, t = (int(i) for i in input())

times = int(t / a)

num = times * b

print(num)


Fixed submission:
a, b, t = (int(i) for i in input().split())
 
times = int(t / a)
 
num = times * b
 
print(num)
Buggy python submission (verdict: Runtime Error):
n = int(input())
V = [int(v) for v in input().split]
C = [int(c) for c in input().split]

G = [v - c for v, c in zip(V, C)]

s = 0
for g in G:
    if g > 0:
        s += g

print(s)

Fixed submission:
n = int(input())
V = [int(v) for v in input().split()]
C = [int(c) for c in input().split()]

G = [v - c for v, c in zip(V, C)]

s = 0
for g in G:
    if g > 0:
        s += g

print(s)
Buggy python submission (verdict: Runtime Error):
in_data = [input() for i in range(3)] 
 
n = int(in_data[0])
s = in_data[1]
k = int(in_data[2])




target_c = s[k]
new_s = ''
for c in s:
    if c == target_c:
        new_s += c
    else:
        new_s += '*'
 
print(new_s)

Fixed submission:
in_data = [input() for i in range(3)] 
 
n = int(in_data[0])
s = in_data[1]
k = int(in_data[2])





target_c = s[k - 1]
new_s = ''
for c in s:
    if c == target_c:
        new_s += c
    else:
        new_s += '*'
 
print(new_s)

Buggy python submission (verdict: Runtime Error):
n, s, k = (int(i) for i in input().split())  


target_c = s[k]
new_s = ''
for c in s:
    if c == target_c:
        new_s += c
    else:
        new_s += '*'

print(new_s)

Fixed submission:
in_data = [input() for i in range(3)] 
 
n = int(in_data[0])
s = in_data[1]
k = int(in_data[2])





target_c = s[k - 1]
new_s = ''
for c in s:
    if c == target_c:
        new_s += c
    else:
        new_s += '*'
 
print(new_s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
H = input.strip().split()

border = 0
can_num = 0
for h in H:
  if h > border:
    can_num += 1
    border = h

print(can_num)



Fixed submission:
n = int(input())
H = [int(i) for i in input().strip().split()]
 
border = 0
can_num = 0
for h in H:
  if h >= border:
    can_num += 1
    border = h
 
print(can_num)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input()) 
A = [int(i) for i in input().split()] 

setA = list(set(A))

d = {a: A.count(a) for a in setA}


#print(d)
r = 0
for k, v in d.items():
    if v > k:
        r += v - k
    elif k > v:
      	r += v

print(r)

Fixed submission:
n = int(input()) 
A = [int(i) for i in input().split()] 

r = 0
d = {}
pass_list = []
for a in A:
    if a in pass_list:
        r += 1
        continue
    r += 1
    if a in d:
        d[a] += 1
        if d[a] == a:
            r -= a
            pass_list.append(a)
    else:
        d[a] = 1
        if d[a] == a:
          r -= a
          pass_list.append(a)

print(r)
Buggy python submission (verdict: Runtime Error):
a,v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if(w>=v):
  print("NO")
else if(abs(b-a)/(v-w) > t):
  print("NO")
else:
  print("YES")


Fixed submission:
a,v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
 
if(w>=v):
  print("NO")
elif(abs(b-a)/(v-w) > t):
  print("NO")
else:
  print("YES")
Buggy python submission (verdict: Runtime Error):
train_normal = input()
train_unlimited = input()
bus_normal = input()
bus_unlimited = input()
train_normal = input()
train = min(train_normal, train_unlimited)
bus = min(bus_normal, bus_unlimited)
total = train + bus
print(total)

Fixed submission:
train_normal = int(input())
train_unlimited = int(input())
bus_normal = int(input())
bus_unlimited = int(input())
train = min(train_normal, train_unlimited)
bus = min(bus_normal, bus_unlimited)
total = train + bus
print(total)

Buggy python submission (verdict: Runtime Error):
i = input()
train = min(i[0], i[1])
bus = min(i[2], i[3])
total = train + bus
print(total)


Fixed submission:
train_normal = int(input())
train_unlimited = int(input())
bus_normal = int(input())
bus_unlimited = int(input())
train = min(train_normal, train_unlimited)
bus = min(bus_normal, bus_unlimited)
total = train + bus
print(total)

Buggy python submission (verdict: Runtime Error):
input = input()
train = max(input[0], input[1])
bus = max(input[2], input[3])
total = train + bus
print(total)

Fixed submission:
train_normal = int(input())
train_unlimited = int(input())
bus_normal = int(input())
bus_unlimited = int(input())
train = min(train_normal, train_unlimited)
bus = min(bus_normal, bus_unlimited)
total = train + bus
print(total)
Buggy python submission (verdict: Runtime Error):
N = int(input())
D, X = map(int, input().split())
A = []
for i in range(N):
    j = int(input())
	k = divmod(D-1,j)
	A.append(1 + k[0])

total = X + sum(A)
print(total)

Fixed submission:
N = int(input())
D, X = map(int, input().split())
A = []
for i in range(N):
    j = int(input())
    k = divmod(D-1,j)
    A.append(1 + k[0])

total = X + sum(A)
print(total)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

A.append(0)
    
total_normal = 0
prev = 0
for a in A:
    length = abs(a-prev)
    total_normal += length
    prev = a

prev = 0
for i in range(N):
    now = A[i]
    nex = A[i + 1]
    ans = total_normal - (abs(now - prev) + abs (nex - now)) + abs(nex - prev)
    print(ans)
    prev = now


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.append(0)
    
total_normal = 0
prev = 0
for a in A:
    length = abs(a-prev)
    total_normal += length
    prev = a

prev = 0
for i in range(N):
    now = A[i]
    nex = A[i + 1]
    ans = total_normal - (abs(now - prev) + abs (nex - now)) + abs(nex - prev)
    print(ans)
    prev = now