Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)

Fixed submission:
from fractions import gcd
from functools import reduce

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)

Fixed submission:
from fractions import gcd
from functools import reduce

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)

Fixed submission:
from fractions import gcd
from functools import reduce

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

res = 0
tmp = reduce(lcm,a)-1
for i in a:
    res += tmp % i
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

res = 1e+9
for i in range(N):
    l = S[:i]
    r = S[i+1:]
    cnt = 0
    cnt += l.count('W')
    cnt += r.count('E')
    res = min(res,cnt)
print(res)

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

def f(S):
    cnt = S.count('E')
    for s in S:
        if s == 'E':
            cnt -= 1
        yield cnt
        if s == 'W':
            cnt += 1

print(min(list(f(S))))
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if a+k-1<b-k+1:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in sorted(set(ans)):
	print(i)

Fixed submission:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
ans = tmp[:k] + tmp[-k:]
for i in sorted(set(ans)):
	print(i)

Fixed submission:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if b-a+1 > k:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in set(ans):
	print(i)

Fixed submission:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if b-a+1 >= k:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in set(ans):
	print(i)

Fixed submission:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
ans = tmp[:k] + tmp[-k:]
for i in set(ans):
	print(i)

Fixed submission:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)

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

l = list(range(A,B+1))
res = set(l[:K] + l[-K:])
for i in sorted(set(res)):
    print(i)

Fixed submission:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)

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

l = list(range(A,B+1))
res = []
for i in range(len(l)):
    if i < K:
        res.append(l[i])
    if B-A+1-K <= i:
        res.append(l[i])

for i in set(res):
    print(i)

Fixed submission:
a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [input() for _ in range(N)]

d = []
for i in A:
    if i in d:
        d.remove(i)
    else:
        d.append(i)
print(len(d))


Fixed submission:
from collections import Counter
N = int(input())
A = [input() for _ in range(N)]

res = 0
#print(Counter(A))

c = Counter(A)
for i in c.values():
    res += i % 2
print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))

c = [0 for _ in range(10**5)]

for i in a:
    c[i-1] += 1
    c[i+1] += 1
    c[i] += 1
print(max(c))

Fixed submission:
from collections import Counter

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

c = [0 for _ in range(10**5+3)]

for i in a:
    c[i-1] += 1
    c[i+1] += 1
    c[i] += 1
print(max(c))

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

res = 0
for i in a:
    cnt = 0
    cnt += a.count(i)
    cnt += a.count(i-1)
    cnt += a.count(i+1)
    res = max(res,cnt)
print(res)

Fixed submission:
from collections import Counter

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

c = [0 for _ in range(10**5+3)]

for i in a:
    c[i-1] += 1
    c[i+1] += 1
    c[i] += 1
print(max(c))
Buggy python submission (verdict: Runtime Error):
S = input()

for i in range(97,26+97):
    if chr(i) not in s:
        print(chr(i))
        exit(0)
else:
    print('None')

Fixed submission:
S = input()

for i in range(97,26+97):
    if chr(i) not in S:
        print(chr(i))
        exit(0)
else:
    print('None')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

b = []
for i in a:
    b.append(i)
    b = b[::-1]
print(' '.join(map(str,b)))

Fixed submission:
from collections import deque

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

d = deque()

for i in range(n):
    if n%2 == 0 and i%2 == 0:
        d.append(a[i])
    elif n%2==1 and i%2==1:
        d.append(a[i])
    else:
        d.appendleft(a[i])
print(' '.join(map(str,list(d))))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(input()) for _ in range(N)]

i = 0
cnt = 1
while True:
    if a[i] == 1:
        cnt = -1
        break
    elif a[i] == 2:
        break
    else:
        i = a[i] - 1
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]

i = 0
cnt = 1
while True:
    if cnt > len(a):
        cnt = -1
        break
    if a[i] == 1:
        cnt = -1
        break
    elif a[i] == 2:
        break
    else:
        i = a[i] - 1
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())

if A+B>=10:
    print('error')
else:
    print(A+b)

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

if A+B>=10:
    print('error')
else:
    print(A+B)
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())

result = 0

for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x + y + z == S:
                result+=1
print(result)

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

result = 0

for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if 0 <= z <= K:
                result+=1
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = 1
for a in A:
  ans *= a

if ans > (10 ** 18):
  ans = -1

print(ans)


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

ans = 1
A.sort()

ans = 1
for a in A:
  ans *= a
  if ans == 0:
    break
  if ans > 10 ** 18:
    ans = -1
    break

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = [input() for i in range(N)]

 
tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]

Fixed submission:
lis = list(map(int, input().split(" ")))

tmp_dic = {}
for n in lis:
    if n not in tmp_dic:
        tmp_dic[n] = 1
    else:
        tmp_dic[n] += 1
        
if len(tmp_dic) == 2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import collections

N = int(input())
cnt_dic = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt_dic[s] += 1

cnt_dic = {k: v for k, v in cnt_dic.items() if v == max(cnt_dic.values())}

for s in sorted(cnt_dic.keys()):
  print(s)


Fixed submission:
import collections

N = int(input())
cnt_dic = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt_dic[s] += 1

max_v = max(cnt_dic.values())

ans_lis = [k for k, v in cnt_dic.items() if v == max_v]

for s in sorted(ans_lis):
  print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = [input() for i in range(N)]

 
tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]

Fixed submission:
import collections

N = int(input())
cnt_dic = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt_dic[s] += 1

max_v = max(cnt_dic.values())

ans_lis = [k for k, v in cnt_dic.items() if v == max_v]

for s in sorted(ans_lis):
  print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = []
[lis.append(input()) for i in range(N)]
 
tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]

Fixed submission:
import collections

N = int(input())
cnt_dic = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt_dic[s] += 1

max_v = max(cnt_dic.values())

ans_lis = [k for k, v in cnt_dic.items() if v == max_v]

for s in sorted(ans_lis):
  print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = []
[lis.append(input()) for i in range(N)]

tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]

Fixed submission:
import collections

N = int(input())
cnt_dic = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt_dic[s] += 1

max_v = max(cnt_dic.values())

ans_lis = [k for k, v in cnt_dic.items() if v == max_v]

for s in sorted(ans_lis):
  print(s)
Buggy python submission (verdict: Runtime Error):
n, k = mapt(int, input().split(" "))
p = mapt(int, input().split(" "))
print(sum(sorted(p)[:3]))

Fixed submission:
n, k = map(int, input().split(" "))
p = map(int, input().split(" "))
print(sum(sorted(p)[:k]))
Buggy python submission (verdict: Runtime Error):
x = int(input())

list1 = list(map(int, input().split(" ")))

def calc():
    result = 1
    if 0 in result:
        print("-1")
        exit()
    for i in list1:
        result *= i
        if result > 1000000000000000000:
            print("-1")
            exit()
    print(result)

calc()

Fixed submission:
def main():
    x = int(input())
    list1 = list(map(int, input().split(" ")))
    result = 1

    if 0 in list1:
        print(0)
        return 
    
    for i in list1:
        result *= i
        if result > 1000000000000000000:
            print("-1")
            exit()
    print(result)

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

remainder = n[-1]
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder in (3): print("bon")

Fixed submission:
n = input()

remainder = int(n[-1])
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder is 3: print("bon")

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

remainder = n%10
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder in (3): print("bon")

Fixed submission:
n = input()

remainder = int(n[-1])
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder is 3: print("bon")
Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
s = mapt(int, input().split(" "))
data = Counter(s)
for i in range(1, n+1):
    print(data.get(i, 0))

Fixed submission:
from collections import Counter

n = int(input())
s = map(int, input().split(" "))
data = Counter(s)
for i in range(1, n+1):
    print(data.get(i, 0))
Buggy python submission (verdict: Runtime Error):
a, b, c = mapt(int, input().split(" "))

print("Yes" if len(set({a,b,c})) == 2 else "No")

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

print("Yes" if len(set({a,b,c})) == 2 else "No")
Buggy python submission (verdict: Runtime Error):
from itertools import combinations

n = int(input())
d = map(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2)))

Fixed submission:
from itertools import combinations

def mapt(fn, *args):
    return tuple(map(fn, *args))

n = int(input())
d = mapt(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2)))

Buggy python submission (verdict: Runtime Error):
from itertools import combinations

n = int(input())
d = mapt(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2)))

Fixed submission:
from itertools import combinations

def mapt(fn, *args):
    return tuple(map(fn, *args))

n = int(input())
d = mapt(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2)))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k, q = map(int, input().split(" "))
    a = (int(input()) for i in range(q))
    d = dict(zip((range(n)), [k]*n))

    for i in a:
        for key in d.keys():
            if (i-1) != key:
                d[key] -= 1

    for value in d.values():
        print("Yes" if value > 0 else "No")
        
main()

Fixed submission:
from collections import defaultdict

def main():
    n, k, q = map(int, input().split(" "))
    a = (int(input()) for i in range(q))
    d = defaultdict(lambda:k-q)
    for i in range(n):
        d[i]

    for i in a:
        d[i-1] += 1

    for value in d.values():
        print("Yes" if value > 0 else "No")


main()
Buggy python submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))

def main():
    n = int(input())
    b = Input()
    data = 0
    for i in range(n-1):
        if i == 0:
            data += b[i]
            continue
        data += min(b[i], b[i-1])
    data += b[-1]
    print(data)
main()

Fixed submission:
def mapt(fn, *args):
    return tuple(map(fn, *args))

def Input():
    return mapt(int, input().split(" "))

def main():
    n = int(input())
    b = Input()
    data = 0
    for i in range(n-1):
        if i == 0:
            data += b[i]
            continue
        data += min(b[i], b[i-1])
    data += b[-1]
    print(data)
main()
Buggy python submission (verdict: Runtime Error):
def Input():
    return map(int, input().split(" "))


def main():
    n = int(input())
    h = list(reversed(Input()))
    count = 0
    ans = 0
    for i in range(n-1):
        if h[i] <= h[i+1]:
            count += 1
        else:
            ans = max(ans, count)
            count = 0
    print(ans)
main()

Fixed submission:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    h = list(reversed(Input()))
    val = 0
    ans = 0
    for i in range(1, n):
        if h[i-1] <= h[i]: val += 1
        else: val = 0
        ans = max(ans, val)
        
    print(ans)
main()

Buggy python submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    h = list(reversed(Input()))
    count = 0
    ans = 0
    for i in range(n-1):
        if h[i] <= h[i+1]:
            count += 1
        else:
            ans = max(ans, count)
            count = 0
    print(ans)
main()

Fixed submission:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    h = list(reversed(Input()))
    val = 0
    ans = 0
    for i in range(1, n):
        if h[i-1] <= h[i]: val += 1
        else: val = 0
        ans = max(ans, val)
        
    print(ans)
main()
Buggy python submission (verdict: Runtime Error):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    if n == 1: print(0); exit()
    k = list(range(1, n+1))
    list1 = [i+1 for i in range(2, n)]
    a = [1] + list1[:] + [2]
    b = [2] + list1[:] + [1]
    ans = 0
    for row in (a, b):
        r = 0
        for x, y in zip(k, row):
            r += x % y
        ans = max(ans, r)
    print(ans)



main()

Fixed submission:
def main():
    n = int(input())
    x = (n *(n-1))//2
    print(x)

main()
Buggy python submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    a = sorted(Input())
    while len(a) > 1:
        x, y = a[0], a[1]
        a[0:2] = [(x+y)/2]

    return a[0]


print(main())

Fixed submission:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))

  
def main():
    n = int(input())
    a = sorted(Input())
    while len(a) > 1:
        x, y = a[0], a[1]
        a[0:2] = [(x+y)/2]
    return a[0]


print(main())
Buggy python submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))

  
def main():
    a, b = Input()
    return max(a*b, a-b, a+b)


print(main())

Fixed submission:
def Input():
    return map(int, input().split(" "))

def main():
    a, b = Input()
    return max(a*b, a-b, a+b)


print(main())
Buggy python submission (verdict: Runtime Error):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))



from itertools import permutations
from collections import Counter


def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n-1)


def combinations_count(n, r=2):
    return factorial(n) // (factorial(n - r) * factorial(r))


def main():
    k = int(input())
    a = sorted(["".join(sorted(input())) for _ in range(k)])
    d = Counter(a)
    return sum(combinations_count(val) for val in d.values() if val > 1)


print(main())

Fixed submission:
from collections import Counter


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    k = int(input())
    a = sorted(["".join(sorted(input())) for _ in range(k)])
    d = Counter(a)
    return int(sum(val*(val-1)/2 for val in d.values()))



print(main())
Buggy python submission (verdict: Runtime Error):

def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    if a % 2 !=  b % 2:
        print("IMPOSSIBLE")
    else:
        print((a+b)//2)

main()

Fixed submission:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    if a % 2 !=  b % 2:
        print("IMPOSSIBLE")
    else:
        print((a+b)//2)

main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    for i in range(n):
        x = 0
        a[i], x = x, a[i]
        print(max(a))
        a[i], x = x, a[i]

main()

Fixed submission:
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    a_copy = sorted(a)
    a_max = a_copy[-1]
    a_second = a_copy[-2]
    for i in range(n):
        if a[i] == a_max:
            print(a_second)
        else:
            print(a_max)


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    for i in range(n):
        a_copy = list(a)
        a_copy.pop(i)
        print(max(a_copy))

main()

Fixed submission:
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    a_copy = sorted(a)
    a_max = a_copy[-1]
    a_second = a_copy[-2]
    for i in range(n):
        if a[i] == a_max:
            print(a_second)
        else:
            print(a_max)


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    for i in range(n):
        ans = -1
        for j in range(n):
            if i == j: continue
            ans = max(ans, a[j])
        print(ans)

main()

Fixed submission:
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    a_copy = sorted(a)
    a_max = a_copy[-1]
    a_second = a_copy[-2]
    for i in range(n):
        if a[i] == a_max:
            print(a_second)
        else:
            print(a_max)


main()
Buggy python submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))


def main():
    n, a, b = Input()
    ans = min(n*a, b)
    print(ans)


main()

Fixed submission:
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, a, b = Input()
    ans = min(n*a, b)
    print(ans)


main()
Buggy python submission (verdict: Runtime Error):
def Input():
    return mapt(int, input().split(" "))

def main():
    a, b = Input()
    print(0 if a < b else 10)

main()

Fixed submission:
def main():
    a, b = map(int, input().split(" "))
    print(0 if a < b else 10)

main()
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    data = [int(input()) for i in range(5)]
    quo, rem = divmod(n, min(data))
	print(4 + quo + bool(rem))

main()

Fixed submission:
def main():
    n = int(input())
    data = [int(input()) for i in range(5)]
    quo, rem = divmod(n, min(data))
    quo = 5 + quo
    if rem:
        print(quo)
    else:
        print(quo - 1)

main()
Buggy python submission (verdict: Time Limit Exceeded):
import re


def main():
    s = input()
    n = 1e9
    ans = 0
    while n > 0:
        s, n = re.subn("01|10", "", s)
        ans += n*2
    print(ans)
    
main()

Fixed submission:
def main():
    s = input()
    zero = s.count("0")
    one = s.count("1")
    print(min(zero, one) * 2)

main()