Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, m = map(int, input().split())
a = list(map(int, input().split()))
l = np.array(a)
for i in range(m):
    idx = l.argmax()
    l[idx] = l[idx]//2
print(sum(l))

Fixed submission:
import heapq
n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)
for _ in range(m):
    t = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-t//2))
print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))
for i in range(m):
    idx = a.index(max(a))
    a[idx] = a[idx]//2
print(sum(a))

Fixed submission:
import heapq
n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)
for _ in range(m):
    t = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-t//2))
print(-sum(a))
Buggy python submission (verdict: Runtime Error):
s = int(input().replace('/',''))
if s > 20190420:
    print("TBD")
else]
    print("Heisei")

Fixed submission:
s = int(input().replace('/',''))
if s > 20190430:
    print("TBD")
else:
    print("Heisei")
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    s = float(x)
    if u = "JPY":
        ans += s
    else:
        ans += (s * 380000.0)
print(s)

Fixed submission:
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    s = float(x)
    if u == "JPY":
        ans += s
    else:
        ans += (s * 380000.0)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n,x=map(int,input().split())
l = [abs(int(i) - x) for i in input().split()]
ans = l[0]
for i in l:
    y = math.gcd(ans,i)
    ans = y
print(ans)

Fixed submission:
import functools
def gcd( a, b ):
    while b != 0:
        a, b = b,a%b
    return a
n,x=map(int,input().split())
l = [abs(int(i) - x) for i in input().split()]
print(functools.reduce(gcd,l))

Buggy python submission (verdict: Runtime Error):
import math
n,x=map(int,input().split())
l = [abs(int(i) - x) for i in input().split()]
ans = l[0]
for i in l:
    ans = math.gcd(ans,i)
print(ans)

Fixed submission:
import functools
def gcd( a, b ):
    while b != 0:
        a, b = b,a%b
    return a
n,x=map(int,input().split())
l = [abs(int(i) - x) for i in input().split()]
print(functools.reduce(gcd,l))

Buggy python submission (verdict: Runtime Error):
from math import gcd
n,x=map(int,input().split())
l = [abs(int(i) - x) for i in input().split()]
ans = l[0]
for i in l:
    ans = gcd(ans,i)
print(ans)

Fixed submission:
import functools
def gcd( a, b ):
    while b != 0:
        a, b = b,a%b
    return a
n,x=map(int,input().split())
l = [abs(int(i) - x) for i in input().split()]
print(functools.reduce(gcd,l))
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,str(bin(n))[2:]))
for i in range(1,len(l)+3): 
    if l[-i] == 2:
        l[-i] = 0
        if i == len(l):
            l.insert(0,1)
        else:
            l[-(i+1)]+=1
    if i%2==0 and l[-i]==1:
        if i == len(l):
            l.insert(0,1)
        else:
            l[-(i+1)]+=1
s = ''.join([str(x) for x in l])
print(s)

Fixed submission:
n=int(input())
flg = 0
if n < 0:
    n *= -1
    flg = 1
l=list(map(int,str(bin(n))[2:]))
for i in range(1,len(l)+3): 
    try:
        if l[-i] == 2:
            l[-i] = 0
            if i == len(l):
                l.insert(0,1)
            else:
                l[-(i+1)]+=1
        if i%2==flg and l[-i]==1:
            if i == len(l):
                l.insert(0,1)
            else:
                l[-(i+1)]+=1
    except:
        pass
s = ''.join([str(x) for x in l])
print(s)

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,str(bin(n))[2:]))
for i in range(1,len(l)+3): 
    if l[-i] == 2:
        l[-i] = 0
        try:
            l[-(i+1)]+=1
        except:
            l.insert(0,1)
    if i%2==0 and l[-i]==1:
        try: 
            l[-(i+1)]+=1
        except:
            l.insert(0,1)
s = ''.join([str(x) for x in l])
print(s)

Fixed submission:
n=int(input())
flg = 0
if n < 0:
    n *= -1
    flg = 1
l=list(map(int,str(bin(n))[2:]))
for i in range(1,len(l)+3): 
    try:
        if l[-i] == 2:
            l[-i] = 0
            if i == len(l):
                l.insert(0,1)
            else:
                l[-(i+1)]+=1
        if i%2==flg and l[-i]==1:
            if i == len(l):
                l.insert(0,1)
            else:
                l[-(i+1)]+=1
    except:
        pass
s = ''.join([str(x) for x in l])
print(s)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

n=int(input())
l=list(map(int,str(bin(n))[2:]))
for i in range(1,len(l)+3): 
    if l[-i] == 2: #2のとき繰上げ
        l[-i] = 0
        try:
            l[-(i+1)]+=1
        except:
            l.insert(0,1)
    if i%2==0 and l[-i]==1: #-2^nが-2のとき01→11に変換
        try: 
            l[-(i+1)]+=1
        except:
            l.insert(0,1)
s = ''.join([str(x) for x in l])
print(s)

Fixed submission:
n=int(input())
flg = 0
if n < 0:
    n *= -1
    flg = 1
l=list(map(int,str(bin(n))[2:]))
for i in range(1,len(l)+3): 
    try:
        if l[-i] == 2:
            l[-i] = 0
            if i == len(l):
                l.insert(0,1)
            else:
                l[-(i+1)]+=1
        if i%2==flg and l[-i]==1:
            if i == len(l):
                l.insert(0,1)
            else:
                l[-(i+1)]+=1
    except:
        pass
s = ''.join([str(x) for x in l])
print(s)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split());print(min(a,b)+min(c,d))

Fixed submission:
a=[int(input()) for i in range(2)];b=[int(input()) for i in range(2)]
print(min(a)+min(b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
cnt = 0
a = [input() for i in range(n)]
set_ = set(a)
for j in set_:
    if a.count(j) % 2 == 1:
        cnt+=1
print(cnt)

Fixed submission:
n = int(input())
a = set()
for i in range(n):
    tmp = int(input())
    if tmp in a:
        a.remove(tmp)
    else:
        a.add(tmp)
print(len(a))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
cnt = 0
a = []
for i in range(n):
    a.append(int(input()))
set_ = set(a)
for j in set_:
    if a.count(j) % 2 == 1:
        cnt+=1
print(cnt)

Fixed submission:
n = int(input())
a = set()
for i in range(n):
    tmp = int(input())
    if tmp in a:
        a.remove(tmp)
    else:
        a.add(tmp)
print(len(a))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split();print(max(a-b,0))

Fixed submission:
a,b = map(int,input().split());print(max(a-b,0))
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
lc = 1
for i in range(n):
    t = int(input())
    lc = lc * t // math.gcd(lc,t)
print(lc)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
n = int(input())
lc = 1
for i in range(n):
    t = int(input())
    lc = lc * t // gcd(lc,t)
print(lc)

Buggy python submission (verdict: Runtime Error):
import math
input()
lc = 1
for i in range(n):
    t = int(input())
    lc = lc * t // math.gcd(lc,t)
print(lc)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
n = int(input())
lc = 1
for i in range(n):
    t = int(input())
    lc = lc * t // gcd(lc,t)
print(lc)

Buggy python submission (verdict: Runtime Error):
import math
input()
t = list(map(int,input().split()))
lc = 1
for i in t:
    lc = lc * t // math.gcd(lc,t)
print(lc)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
n = int(input())
lc = 1
for i in range(n):
    t = int(input())
    lc = lc * t // gcd(lc,t)
print(lc)
Buggy python submission (verdict: Runtime Error):
from _overlapped import NULL
n = int(input())
a = list(map(int,input().split()))
ans = NULL
for i in range(n):
    tmp = abs(sum(a[:i])-sum(a[i:]))
    if ans == NULL:
        ans = tmp
    if tmp < ans:
        ans = tmp
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = -1
sum_ = sum(a)
sunuke = 0
for i in range(n-1):
    sum_ -= a[i]
    sunuke += a[i]
    tmp = abs(sum_ - sunuke)
    if ans == -1:
        ans = tmp
    if ans > tmp:
        ans = tmp
print(ans)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input(),split()))
a.sort(reverse = True)
print(sum(a[0:2]))

Fixed submission:
a = list(map(int,input().split()))
a.sort()
print(sum(a[0:2]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in a:
    ans.append(i)
    ans = ans[::-1]
let = ""
for j in ans:
    let += str(j) + " "
print(let[:-1])

Fixed submission:
n = int(input())
a = list(input().split())
ans = ' '.join(a[::-2])
if n % 2 == 0:
    ans += " " + ' '.join(a[::2])
else:
    ans += " " + ' '.join(a[1::2])
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
print(max(a)-min(a)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
print(max(a)-min(a))
Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
pw = ""
for i in range(e):
    pw+= o[i] + e[i]
if len(o) != len(e):
    pw += o[-1]
print(pw)

Fixed submission:
o = input()
e = input()
pw = ""
for i in range(len(e)):
    pw+= o[i] + e[i]
if len(o) != len(e):
    pw += o[-1]
print(pw)
Buggy python submission (verdict: Runtime Error):
print("ABC" if int(input() < 1200 else "ARC")

Fixed submission:
print(['ARC','ABC'][int(input())<1200])
Buggy python submission (verdict: Runtime Error):
from copy import deepcopy
n = int(input())
t = list(map(int,input().split()))
m = int(input())
p = []
x = []
for i in range(m):
    tmpp,tmpx = map(int,input().split())
    p.append(tmpp)
    x.append(tmpx)
for j in p:
    tmplist = deepcopy(t)
    tmplist[j-1] = x[j-1]
    print(sum(tmplist))

Fixed submission:
from copy import deepcopy
n = int(input())
t = list(map(int,input().split()))
m = int(input())
p = []
x = []
for i in range(m):
    tmpp,tmpx = map(int,input().split())
    p.append(tmpp)
    x.append(tmpx)
for j in range(len(p)):
    tmplist = deepcopy(t)
    tmplist[p[j]-1] = x[j]
    print(sum(tmplist))
Buggy python submission (verdict: Runtime Error):
print("vowel" if input() in 'a','e','i','o','u' else ""consonant)

Fixed submission:
s = input()
chk = ['a','e','i','o','u']
print("vowel" if s in chk else "consonant")
Buggy python submission (verdict: Runtime Error):
a = list(input().split)
a = set()
print(len(a))

Fixed submission:
a = list(map(int,input().split()))
a = set(a)
print(len(a))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=input().split()
answer=1
for i in range(N):
  answer=answer*int(A[i])
if answer>1*10**18:
  print(-1)
else:
  print(answer)


Fixed submission:
N=int(input())
A=input().split()
answer=1
for i in range(N):
  if int(A[i])==0:
    answer=0
for i in range(N):
  answer=answer*int(A[i])
  if answer>1*10**18:
    answer=-1
    break
print(answer)
Buggy python submission (verdict: Runtime Error):
K=int(input())
S=list(input())
answer=[]
for i in range(K):
  answer.append(S[i])
  
answer.append('...')
s=''
for i in range(len(answer)):
  s+=answer[i]
  
print(s)

Fixed submission:
K=int(input())
S=list(input())
if len(S)>K:
  answer=[]
  for i in range(K):
    answer.append(S[i])
  answer.append('...')
  s=''
  for i in range(len(answer)):
    s+=answer[i]
  print(s)
else:
  g=''
  for i in range(len(S)):
    g+=S[i]
  print(g)
Buggy python submission (verdict: Runtime Error):
N,M,X=map(int,input().split())
ca=[list(map(int,input().split())) for i in range(N)]
ans=float('inf')
for i in range(1,2**N):
  money=0
  rikaido=[0]*M
  for j in range(M):
    if i>>j&1:
      money+=ca[j][0]
      for k in range(1,M+1):
        rikaido[k-1]+=ca[j][k]
    for l in range(M):
      if all(rikaido[l]>=X for l in range(M)):
        ans=min(ans,money)

if ans==float('inf'):
  print(-1)
else:
  print(ans)

Fixed submission:
S=input()
T=input()
count=1
for i in range(len(S)):
  if S[i]==T[i]:
    count=1
  else:
    count=0
    break
    
if count==1:
  if (len(S)+1)==len(T):
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N,M,X=map(int,input().split())
ca=[list(map(int,input().split())) for i in range(N)]
ans=float('inf')
for i in range(1,2**N):
  money=0
  rikaido=[0]*M
  for j in range(M):
    if i>>j&1:
      money+=ca[j][0]
      for k in range(1,M+1):
        rikaido[k-1]+=ca[j][k]
    for l in range(M):
      if all(rikaido[l]>=X for l in range(M)):
        ans=min(ans,money)

if ans==float('inf'):
  print(-1)
else:
  print(money)

Fixed submission:
S=input()
T=input()
count=1
for i in range(len(S)):
  if S[i]==T[i]:
    count=1
  else:
    count=0
    break
    
if count==1:
  if (len(S)+1)==len(T):
    print('Yes')
  else:
    print('No')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = []
B = []
result = [0]*M
for i in range(M):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

for a, b in zip(A, B):
    if H[a-1] < H[b-1]:
        result[a-1] = 1

for a, b in zip(A, B):
    if H[a-1] > H[b-1]:
        result[b-1] = 1

C =A+B
D = N - len(set(C))
print(result.count(1)+D)

Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = []
B = []
result = [1]*N
for i in range(M):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

for a, b in zip(A, B):
    if H[a-1] <= H[b-1]:
        result[a-1] = 0

for a, b in zip(B, A):
    if H[a-1] <= H[b-1]:
        result[a-1] = 0

print(result.count(1))
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
result = 0
import fractions

for a in range(1, K+1):
    for b in range(1, K+1):
        d = fractions.gcd(a, b)
        for c in range(1, K+1):
            result += fractions.gcd(d, c)

print(result)

Fixed submission:
K = int(input())
import math
result = 0
for a in range(1, K + 1):
    for b in range(1, K + 1):
        d = math.gcd(a, b)
        for c in range(1, K + 1):
            result += math.gcd(d, c)

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
while N > 0:
    N -= K

if abs(N + K) > abs(N):
    print(abs(N))
elif abs(N + K) < abs (N):
    print(abs(N + K))
else:
    print(abs(N))

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

N -= K * (C)

if abs(N - K) > abs(N):
    print(abs(N))
elif abs(N - K) < abs (N):
    print(abs(N - K))
else:
    print(abs(N))
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
F = A + B
C = N // F
D = N % C
E = A * C
if A == 0:
  print(0)
elif B == 0:
  if A > N:
    print(A - N)
  else:
    print(N)
elif C == 0:
  if N < A:
    print(N)
  else:
    print(A)
else:
  if D < A:
    print(E + D)
  else:
    print(E + A)
  


Fixed submission:
N, A, B = map(int, input().split())
C = N // (A + B) * A + N % (A + B)
D = N // (A + B) * A + A
if A == 0:
    print(0)
elif B == 0:
    print(N)
elif N % (A + B) > A:
    print(D)
else:
    print(C)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
F = A + B
C = N // F
D = N % C
E = A * C
if A == 0:
  print(0)
elif B == 0:
  print(A)
elif C == 0:
  if N < A:
    print(N)
  else:
    print(A)
else:
  if D < A:
    print(E + D)
  else:
    print(E + A)
  


Fixed submission:
N, A, B = map(int, input().split())
C = N // (A + B) * A + N % (A + B)
D = N // (A + B) * A + A
if A == 0:
    print(0)
elif B == 0:
    print(N)
elif N % (A + B) > A:
    print(D)
else:
    print(C)
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
Q = int(input())
query = [input().split() for _ in range(Q)]

for i in range(Q):
    if query[i][0] == "1":
        S.reverse()
    else:
        if query[i][1] == "1":
            S.insert(0, query[i][2])
        else:
            S.append(query[i][2])

print("".join(S))

Fixed submission:
S = input()

from collections import deque
S = deque(S)
Q = int(input())
query = [input().split() for _ in range(Q)]
reverse = 0
for i in range(Q):
    if query[i][0] == "1":
        reverse += 1
    else:
        if query[i][1] == "1":
            if reverse % 2 != 0:
                S.append(query[i][2])
            else:
                S.appendleft(query[i][2])
        else:
            if reverse % 2 != 0:
                S.appendleft(query[i][2])
            else:
                S.append(query[i][2])

result = "".join(S)
if reverse % 2 != 0:
    result = result[::-1]

print(result)
Buggy python submission (verdict: Runtime Error):
A = ["x"]*N
for a, b in zip(S, C):
    if A[a-1] == "x":
        A[a-1] = b
    else:
        if b == A[a-1]:
            A[a-1] = b
        else:
            print(-1)
            exit()

if N != 1 and A[0] == "x":
    A[0] = 1

if A[0] == "x":
    if N != 1:
        print(-1)
        exit()
if A[0] == 0 and N != 1:
    print(-1)
    exit()

for a in range(N):
    if A[a-1] == "x":
        A[a-1] = 0
for a in A:
    print(a, end="")

Fixed submission:
N, M = map(int, input().split())
S = []
C = []
for i in range(M):
    s, c = input().split()
    S.append(int(s))
    C.append(int(c))


A = ["x"]*N
for a, b in zip(S, C):
    if A[a-1] == "x":
        A[a-1] = b
    else:
        if b == A[a-1]:
            A[a-1] = b
        else:
            print(-1)
            exit()

if N != 1 and A[0] == "x":
    A[0] = 1

if A[0] == "x":
    if N != 1:
        print(-1)
        exit()
if A[0] == 0 and N != 1:
    print(-1)
    exit()

for a in range(N):
    if A[a-1] == "x":
        A[a-1] = 0
for a in A:
    print(a, end="")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split())
         
for a in A:
      if a % 2 == 1:
         continue
      if a % 3 == 0:
         continue
      if a % 5 == 0:
         continue
         print("DENIED")
         exit()

print("APPROVED")         

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
for a in A:
  if a % 2 == 1:
    continue
  if a % 3 == 0 or a % 5 == 0:
    continue
  print("DENIED")
  exit()
print("APPROVED")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if A.count(a) != 1:
        print("NO")
        exit()

print("YES")

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
if len(set(A)) == N:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))
result = 0
B = []

for i in range(len(P)-K+1):
    B.append(sum(P[i:i+K]))
        
A = B.index(max(B))
print(sum(P[A:A+K])/2+0.5*K)

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
result = 0
B = [a / 2 + 0.5 for a in P]

result = sum(B[0:K])
t = sum(B[0:K])
for i in range(N-K):
    t -= B[i]
    t += B[i+K]
    if t > result:
        result = t

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))
result = 0
A = [0]

for i in range(len(P)-K+1):
    if sum(P[i:i+K]) > result:
        result = sum(P[i:i+K])
        A = P[i:i+K]

answer = 0

for a in A:
    answer += a/2+0.5

print(answer)

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
result = 0
B = [a / 2 + 0.5 for a in P]

result = sum(B[0:K])
t = sum(B[0:K])
for i in range(N-K):
    t -= B[i]
    t += B[i+K]
    if t > result:
        result = t

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))
B = []
result = []
for a in P:
    B.append(a/2+0.5)

for i in range(len(P)-K+1):
    result.append(sum(B[i:i+K]))

print(max(result))

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
result = 0
B = [a / 2 + 0.5 for a in P]

result = sum(B[0:K])
t = sum(B[0:K])
for i in range(N-K):
    t -= B[i]
    t += B[i+K]
    if t > result:
        result = t

print(result)
Buggy python submission (verdict: Runtime Error):
H, N = map(int, input().split())
A = list(map(int, input().split()))
MAX = sum(A)

if MAX < H:
  print("No)
else:
  print("Yes")

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

if MAX < H:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
from fractions import gcd
 
print(A * B // gcd(A, B)

Fixed submission:
A, B = map(int, input().split())
from fractions import gcd
 
print(A * B // gcd(A, B))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
from fraction import gcd
 
print(A * B // gcd(A, B))

Fixed submission:
A, B = map(int, input().split())
from fractions import gcd
 
print(A * B // gcd(A, B))

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

print(A * B // math.gcd(A, B))

Fixed submission:
A, B = map(int, input().split())
from fractions import gcd
 
print(A * B // gcd(A, B))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
import math
C = math.gcd(A, B)
print(A * B // C)

Fixed submission:
A, B = map(int, input().split())
from fractions import gcd
 
print(A * B // gcd(A, B))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
import math
C = math.gcd(A, B)
print(A * B // C)

Fixed submission:
A, B = map(int, input().split())
from fractions import gcd
 
print(A * B // gcd(A, B))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
import math
C = math.gcd(A, B)
print(A * B // C)

Fixed submission:
A, B = map(int, input().split())
from fractions import gcd
 
print(A * B // gcd(A, B))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [sorted(input()) for i in range(N)]
SS = []
for i in S:
    SS.append("".join(i))
count = 0

SSS = set(SS)

for i in SSS:
    A = SS.count(i)
    count += (A*(A-1)) // 2

print(count)

Fixed submission:
N = int(input())
S = [sorted(list(input())) for _ in range(N)]
import collections
A = []
for a in S:
    A.append("".join(a))
count = 0
c = collections.Counter(A)
for a in c.values():
    count += a*(a-1)//2

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [sorted(list(input())) for _ in range(N)]
i = 0
A = []
for a in S:
    A.append("".join(a))

count = 0
for a in A[:N]:
    count += A[i+1:].count(a)
    i += 1

print(count)

Fixed submission:
N = int(input())
S = [sorted(list(input())) for _ in range(N)]
import collections
A = []
for a in S:
    A.append("".join(a))
count = 0
c = collections.Counter(A)
for a in c.values():
    count += a*(a-1)//2

print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for _ in range(N)]
result = []
for i in range(N):
    C = A[i]
    A[i] = 0
    result.append(max(A))
    A[i] = C

for a in result:
    print(a)

Fixed submission:
r = int(input())
rr = r ** 2
print(3 * rr)