Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
def calc(state, print_state):
  times = 0
  while "BW" in print_state:
      for i in range(len(state)):
          if state[i] == "B":
              if i < len(state)-1 and state[i+1] == "W":
                  state[i] = "W"
                  state[i+1] = "B"
                  times += 1
                  print_state = "".join(state)            
  print(times)
    
if __name__ == "__main__":
  start = time.time()
  state = list(input())
  print_state = "".join(state)
  calc(state, print_state)

Fixed submission:
# coding: utf-8

s = list(input())
time = 0
count = 0
for i in range(len(s)):
  if s[i] == "W":
    time += i - count
    count += 1

print(time)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

state = list(input())
print_state = "".join(state)

times = 0
while "BW" in print_state:
    for i in range(len(state)):
        if state[i] == "B":
            if i < len(state)-1 and state[i+1] == "W":
                state[i] = "W"
                state[i+1] = "B"
                times += 1
                print_state = "".join(state)
                
print(times)

Fixed submission:
# coding: utf-8

s = list(input())
time = 0
count = 0
for i in range(len(s)):
  if s[i] == "W":
    time += i - count
    count += 1

print(time)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

state = list(input())
print_state = "".join(state)

times = 0
while "BW" in print_state:
    for i in range(len(state)):
        if state[i] == "B":
            if i < len(state)-1 and state[i+1] == "W":
                state[i] = "W"
                state[i+1] = "B"
                times += 1
                print_state = "".join(state)
                
print(times)
    

Fixed submission:
# coding: utf-8

s = list(input())
time = 0
count = 0
for i in range(len(s)):
  if s[i] == "W":
    time += i - count
    count += 1

print(time)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N, K = map(int, input().split())
H = []
for i in range(N):
    h = int(input())
    H.append(h)
H.sort()
L = []
for i in range(N-K+1):
    tmp = H[i:i+K]
    L.append(abs(tmp[0] - tmp[-1]))
print(min(L))

Fixed submission:
n, k = map(int, input().split())
tree = [int(input()) for _ in range(n)]
tree.sort()
print(min(tree[i+k-1] - tree[i] for i in range(n-k+1)))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=0
for i in range(n):
    k=i+1
    if k>8*10**8:
        break
    s=set(list(str(k)))
    if len(s)==3 and "3" in s and "5" in s and "7" in s:
        ans+=1
print(ans)


Fixed submission:
#coding: utf-8
from collections import Counter
N = int(input())
l = ["0", "3", "5", "7"]
ans = ["0" for _ in range(9)]
cnt = 0
for a in l:
    ans[0] = a
    for b in l:
        ans[1] = b
        for c in l:
            ans[2] = c
            for d in l:
                ans[3] = d
                for e in l:
                    ans[4] = e
                    for f in l:
                        ans[5] = f
                        for g in l:
                            ans[6] = g
                            for h in l:
                                ans[7] = h
                                for i in l:
                                    ans[8] = i
                                    ans_i = int("".join(ans))
                                    ans_c = Counter(str(ans_i))
                                    if ans_i <= N and "0" not in str(ans_i) and len(ans_c.keys()) == 3 and len(str(ans_i)) >= 3:
                                        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input())
print(int(X + Y/2))

Fixed submission:
a, b = map(int, input().split())
print(int(a+b/2))

Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input())
print(X + Y/2)

Fixed submission:
a, b = map(int, input().split())
print(int(a+b/2))

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
print(a+b/2)

Fixed submission:
a, b = map(int, input().split())
print(int(a+b/2))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
A.sort()
L = []
if A[N//2] < A[N//2+1]:
    flag = True
else:
    flag = False
for i in range(N//2):
    if flag:
        L.append(A[N//2-1-i])
        L.append(A[-1-i])
    else:
        L.append(A[-1-i])
        L.append(A[N//2-1-i])
ans = 0
if N % 2 == 1:
    L.append(A[N//2])
for i in range(N-1):
    ans += abs(L[i] - L[i+1])
print(ans)

Fixed submission:
# coding: utf-8
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
A.sort()
L1, L2 = [0] * N, [0] * N
L1[0] = A[N//2]
L2[0] = A[N//2]
for i in range(1, N):
    if i % 2 == 0:
        L1[i] = A[i//2-1]
        L2[i] = A[-i//2]
    else:
        L1[i] = A[-i//2]
        L2[i] = A[i//2]
a1, a2 = 0, 0
for i in range(N-1):
    a1 += abs(L1[i] - L1[i+1])
    a2 += abs(L2[i] - L2[i+1])
print(max(a1, a2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
if N == 1:
  print("Hello World")
else:
  print(A+B)

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):
#coding: utf-8
from collections import Counter
N = int(input())
l = list(map(int,input().split()))
if len(set(l)) > 1:
  o, e = [], []
  for i in range(N):
    if i % 2==0:
      e.append(l[i])
    else:
      o.append(l[i])
  oc, oe = Counter(o).most_common(2), Counter(e).most_common(2)
  print(len(l) - oc[0][1] - oe[0][1] if oc[0][1] != oe[0][1] else len(l) - max(oc[0][1] + oe[1][1], oc[1][1] + oe[0][1]))

else:
  print(len(l) // 2)

Fixed submission:
#coding: utf-8
from collections import Counter
N = int(input())
l = list(map(int,input().split()))
if len(set(l)) > 1:
  o, e = [], []
  for i in range(N):
    if i % 2==0:
      e.append(l[i])
    else:
      o.append(l[i])
  oc, oe = Counter(o).most_common(2), Counter(e).most_common(2)
  print(len(l) - oc[0][1] - oe[0][1] if oc[0][0] != oe[0][0] else len(l) - max(oc[0][1] + oe[1][1], oc[1][1] + oe[0][1]))

else:
  print(len(l) // 2)
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
from functools import reduce
def gcd(a, b):
    if b == 0:
        return a

    else:
        return gcd(b, a%b)
N, X = map(int, input().split())
x = list(map(int, input().split()))
x = [abs(X - x[i]) for i in range(N)]
l = [x[0]]
for i in range(len(x)):
    for j in range(i+1, len(x)):
        l.append(gcd(max(x[i], x[j]), min(x[i], x[j])))
print(min(l))

Fixed submission:
#coding: utf-8
from functools import reduce
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
N, X = map(int, input().split())
x = list(map(int, input().split()))
x = [abs(X - x[i]) for i in range(N)]
l = reduce(gcd, x)
print(l)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
from functools import reduce
def gcd(a, b):
    if b == 0:
        return a

    else:
        return gcd(b, a%b)
N, X = map(int, input().split())
x = list(map(int, input().split()))
x = [abs(X - x[i]) for i in range(N)]
l = [x[0]]
for i in range(len(x)):
    for j in range(1, len(x)):
        l.append(gcd(max(x[i], x[j]), min(x[i], x[j])))
print(min(l))

Fixed submission:
#coding: utf-8
from functools import reduce
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
N, X = map(int, input().split())
x = list(map(int, input().split()))
x = [abs(X - x[i]) for i in range(N)]
l = reduce(gcd, x)
print(l)

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
from math import gcd
from functools import reduce
N, X = map(int, input().split())
x = list(map(int, input().split()))
x = [abs(X - x[i]) for i in range(N)]
l = reduce(gcd, x)
print(l)

Fixed submission:
#coding: utf-8
from functools import reduce
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
N, X = map(int, input().split())
x = list(map(int, input().split()))
x = [abs(X - x[i]) for i in range(N)]
l = reduce(gcd, x)
print(l)
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
N = list(map(int, list(input())))
K = int(input())
if N[0] == 1:
    print(N[1])
else:
    print(N[0])

Fixed submission:
#coding: utf-8
N = input()
K = int(input())
ans = 0
for i in range(min(K, len(N))):
    if int(N[i]) != 1:
        ans = N[i]
        #print(N[i])
        break
print(ans if ans != 0 else 1)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
    if A[i] % 2 == 0:
        ans += factorization(A[i])[0][1]
print(ans)

Fixed submission:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
l = [2**i for i in range(29, -1, -1)]
ans = 0
for i in range(N):
    flag = False
    for j in range(len(l)):
        if A[i] % l[j] == 0 and flag==False:
            ans += 29 - j
            flag = True
print(ans)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
N = int(input())
for h in range(1, 3501):
    for n in range(1, 3501):
        w = (N*(h+n)) / (4*h*n-N)
        if w != int(w) or w < 0:
            continue
        if N == 4*h*n*w / (h+n+w):
            print(h, n, int(w))
            exit()

Fixed submission:
# coding: utf-8
N = int(input())
for h in range(1, 3501)[::-1]:
    for n in range(1, 3501)[::-1]:
        if 4*h*n-N*(h+n) == 0:
            continue
        w = (N*(h*n)) / (4*h*n-N*(h+n))
        if w != int(w) or w <= 0:
            continue
        w = int(w)
        if 4/N == (n*w+h*w+h*n)/(h*n*w):# and 1 <= h <= 3500 and 1 <= n <= 3500 and 1 <= w <= 3500:
            print(h, n, w)
            exit()
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N = int(input())
d = {}
for i in range(N):
    a = int(input())
    if a not in d.keys():
        d[a] = 1
    else:
        d[a] += 1
ans = 0
for a in d.items():
    ans += a[1] % 2
print(ans)

Fixed submission:
# coding: utf-8
N = int(input())
d = {}
for i in range(N):
    a = int(input())
    if a not in d.keys():
        d[a] = 1
    else:
        d[a] += 1
ans = 0
for a in d.items():
    ans += a[1] % 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
ans = ""
for i in range(N):
    if i % 2 == 0:
        ans += str(A[i])
    else:
        ans = str(A[i]) + ans
if N % 2 != 0:
    for i in range(N-1, -1, -2):
        print(A[i], end=" ")
    for i in range(1, N, 2):
        print(A[i], end=" ")
else:
    for i in range(N-1, 0, -2):
        print(A[i], end=" ")
    for i in range(0, N, 2):
        print(A[i], end=" ")

Fixed submission:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
if N % 2 != 0:
    for i in range(N-1, -1, -2):
        print(A[i], end=" ")
    for i in range(1, N, 2):
        print(A[i], end=" ")
else:
    for i in range(N-1, 0, -2):
        print(A[i], end=" ")
    for i in range(0, N, 2):
        print(A[i], end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
ans = ""
for i in range(N):
    if i % 2 == 0:
        ans += str(A[i])
    else:
        ans = str(A[i]) + ans
if N % 2 != 0:
    for i in range(N-1, -1, -2):
        print(A[i], end=" ")
    for i in range(1, N, 2):
        print(A[i], end=" ")
else:
    for i in range(N-1, 0, -2):
        print(A[i], end=" ")
    for i in range(0, N, 2):
        print(A[i], end=" ")

Fixed submission:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
if N % 2 != 0:
    for i in range(N-1, -1, -2):
        print(A[i], end=" ")
    for i in range(1, N, 2):
        print(A[i], end=" ")
else:
    for i in range(N-1, 0, -2):
        print(A[i], end=" ")
    for i in range(0, N, 2):
        print(A[i], end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
ans = []
for i in range(N):
    if i % 2 == 0:
        ans.append(A[i])
    else:
        ans = [A[i]] + ans
if N % 2 != 0:
    print(*ans[::-1])
else:
    print(*ans)

Fixed submission:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
if N % 2 != 0:
    for i in range(N-1, -1, -2):
        print(A[i], end=" ")
    for i in range(1, N, 2):
        print(A[i], end=" ")
else:
    for i in range(N-1, 0, -2):
        print(A[i], end=" ")
    for i in range(0, N, 2):
        print(A[i], end=" ")
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
L = [0 for _ in range(8)]
N = int(input())
A = list(map(int, input().split()))
v = 0
for i in range(N):
    idx = A[i] // 400
    if idx > 8:
        v += 1
    else:
        L[idx] += 1
amin, amax = 0, 0
for i in range(len(L)):
    if L[i] > 0:
        amin += 1
    if L[i] == 0 and v > 0:
        L[i] += 1
        v -= 1
amin = max(1, amin)
for i in range(len(L)):
    if L[i] > 0:
        amax += 1
print(amin, amax)

Fixed submission:
# coding: utf-8
L = [0 for _ in range(8)]
N = int(input())
A = list(map(int, input().split()))
v = 0
for i in range(N):
    idx = A[i] // 400
    if idx >= 8:
        v += 1
    else:
        L[idx] += 1
amin, amax = 0, 0
for i in range(len(L)):
    if L[i] > 0:
        amin += 1
    # if L[i] == 0 and v > 0:
    #     L[i] += 1
    #     v -= 1
# amin = max(1, amin)
# for i in range(len(L)):
#     if L[i] > 0:
#         amax += 1
print(max(1, amin), amin + v)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N = int(input())
mod = 10**9 + 7
ans = 1
for i in range(1, N+1):
    ans *= i
print(ans % mod)

Fixed submission:
# coding: utf-8
N = int(input())
mod = 10**9 + 7
ans = 1
for i in range(1, N+1):
    ans = ans * i % mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N = int(input())
mod = 10**9 + 7
ans = 1
for i in range(1, N+1):
    ans *= i
print(ans % mod)

Fixed submission:
# coding: utf-8
N = int(input())
mod = 10**9 + 7
ans = 1
for i in range(1, N+1):
    ans = ans * i % mod
print(ans)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
N = int(input())
if N == 1:
    print(1)
    exit()
ans = 0
for i in range(1, N+1):
    if ans < N:
        ans += i
    else:
        end = i
        break
res = ans - N
for i in range(1, end):
    if i != res:
        print(i)

Fixed submission:
# coding: utf-8
N = int(input())
if N == 1:
    print(1)
    exit()
ans = 0
for i in range(1, N+1):
    ans += i
    if ans >= N:
        end = i
        break
res = ans - N
for i in range(1, end+1):
    if i != res:
        print(i)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
from math import ceil
from statistics import median, mean
N = int(input())
A = list(map(int, input().split()))
A.sort()
if N % 2 == 0:
    m = ceil((A[N//2] + A[N//2+1]) / 2)
else:
    m = A[N//2]
ans = 0
for i in range(N):
    ans += (A[i] - m)**2
print(ans)

Fixed submission:
# coding: utf-8
from math import ceil
from statistics import median, mean
N = int(input())
A = list(map(int, input().split()))
ans = 10**9
for m in range(-100, 101):
    tmp = 0
    for i in range(N):
        tmp += (A[i] - m)**2
    ans = min(ans, tmp)
print(ans)
Buggy python submission (verdict: Runtime Error):
#from sys import stdin

#input = stdin.readline
#inputRstrip = stdin.readline().rstrip

#x = input().rstrip()
#n = int(input())

#a,b,c = input().split()
#a,b,c = map(int, input().split())

ST = [input() for i in range(2)]
S = ST[0]
T = ST[1]
ans = len(T)

for i in range(len(S) - len(T) + 1):
	count = len(T)
	for j in range(len(T)):
		if(T[j] == S[i + j]):
			count -= 1
	if(ans > count):
		ans = count
print(ans)

Fixed submission:

from sys import stdin

input = stdin.readline().rstrip

#x = input().rstrip()
#n = int(input())

#a,b,c = input().split()
#a,b,c = map(int, input().split())

D,T,S = map(int, input().split(" "))

if(T * S >= D):
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):

from sys import stdin

input = stdin.readline().rstrip

#x = input().rstrip()
#n = int(input())

#a,b,c = input().split()
#a,b,c = map(int, input().split())

D,T,S = input().split()

if(T * S >= D):
	print("Yes")
else:
	print("No")

Fixed submission:

from sys import stdin

input = stdin.readline().rstrip

#x = input().rstrip()
#n = int(input())

#a,b,c = input().split()
#a,b,c = map(int, input().split())

D,T,S = map(int, input().split(" "))

if(T * S >= D):
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):

mod = 10 ** 9 + 7


N = int(input().rstrip())
As = list(map(int, input().rstrip().split()))
ans = 0
add = 0

for i in range(N - 1):
	add = 0
	for j in range(1, N - i):
		add += As[i + j]
	ans += As[i] * add
print(ans % mod)


Fixed submission:

mod = 10 ** 9 + 7


N = int(input().rstrip())
As = list(map(int, input().rstrip().split()))
ans = 0
add = 0

for i in range(N):
	add += As[i]
	add %= mod
ans = add * add % mod

for i in range(N):
	ans -= As[i] * As[i] % mod
	if (ans < 0):
		ans += mod

ans *= int((mod + 1) / 2)
ans %= mod

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

mod = 10 ** 9 + 7


N = int(input().rstrip())
As = list(map(int, input().rstrip().split()))
ans = 0

for i in range(N - 1):
	for j in range(1, N - i):
		ans += As[i] * As[i + j]
	
print(ans % mod)



Fixed submission:

mod = 10 ** 9 + 7


N = int(input().rstrip())
As = list(map(int, input().rstrip().split()))
ans = 0
add = 0

for i in range(N):
	add += As[i]
	add %= mod
ans = add * add % mod

for i in range(N):
	ans -= As[i] * As[i] % mod
	if (ans < 0):
		ans += mod

ans *= int((mod + 1) / 2)
ans %= mod

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

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

ans = True if N % 9 == 0 else False

print("Yes" if ans else "Np")

Fixed submission:

N = int(input())

if(N % 9 == 0):
	ans = True
else:
	ans = False



print("Yes" if ans else "No")
Buggy python submission (verdict: Runtime Error):

N = input()
Ns = list(map(int, input().split()))
Ns.sort()
ans = 0

for i in range(0, Ns - 2):
	for j in range(i, Ns - 1):
		for k in range(j, Ns):
			if(Ns[i] + Ns[j] > Ns[k] and Ns[j] + Ns[k] > Ns[i] and Ns[k] + Ns[i] > Ns[j]):
				ans += 1
print(ans)

Fixed submission:

N = int(input())
Ns = list(map(int, input().split()))
Ns.sort()
ans = 0

for i in range(0, N - 2):
	for j in range(i + 1, N - 1):
		for k in range(j + 1, N):
			if(Ns[i] == Ns[j] or Ns[k] == Ns[j]):
				continue

			if(Ns[i] + Ns[j] > Ns[k] and Ns[j] + Ns[k] > Ns[i] and Ns[k] + Ns[i] > Ns[j]):
				ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):

Ns = list(map(int, input().split()))
Ns.sort()
ans = 0

for i in range(0, Ns - 2):
	for j in range(i, Ns - 1):
		for k in range(j, Ns):
			if(Ns[i] + Ns[j] > Ns[k]
				and Ns[j] + Ns[k] > Ns[i] 
				and Ns[k] + Ns[i] > Ns[j]):
				ans += 1
print(ans)

Fixed submission:

N = int(input())
Ns = list(map(int, input().split()))
Ns.sort()
ans = 0

for i in range(0, N - 2):
	for j in range(i + 1, N - 1):
		for k in range(j + 1, N):
			if(Ns[i] == Ns[j] or Ns[k] == Ns[j]):
				continue

			if(Ns[i] + Ns[j] > Ns[k] and Ns[j] + Ns[k] > Ns[i] and Ns[k] + Ns[i] > Ns[j]):
				ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


o = list(input())
e = list(input())

for i in range(len(o)):
    print(o[i]+e[i],end="")
    

Fixed submission:
# -*- coding: utf-8 -*-


o = list(input())
e = list(input())

i = 0

while i < max(len(o),len(e)):
    if(i<len(o)):
        print(o[i],end="")
    if(i<len(e)):
        print(e[i],end="")
    i += 1
Buggy python submission (verdict: Runtime Error):
D = input('距離')
T = input('時間')
S = input('速度')
if D/S < T:
  print('Yes')
else:
  print('No')

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

if D/S <= T:
    print('Yes')
else:
  	print('No')
Buggy python submission (verdict: Runtime Error):
q = [0,1,2]

A = int(input())
B = int(input())

q.remove(A)
q.remove(B)

print(q[0])


Fixed submission:
q = [1,2,3]

A = int(input())
B = int(input())

q.remove(A)
q.remove(B)

print(q[0])
Buggy python submission (verdict: Runtime Error):
num = int(input())

s1 = input()
s2 = input()
ans=""
for i in range(num):
    ans+=s1[i]
    ans+=s2[i]

print(ans)


Fixed submission:
num = int(input())
ans=""
(s1,s2) = input().split(" ")



for i in range(num):
    ans+=s1[i]
    ans+=s2[i]

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

import math

(A,B) = map(int,input().split(" "))
ans = (A * B) // math.gcd(A, B)
print(ans)


Fixed submission:
#最小公倍数を求める

(A,B) = map(int,input().split(" "))

m=max(A,B)
n=min(A,B)
while m%n != 0:
    temp = n
    n = m%n
    m = temp


print(A*B // n)

Buggy python submission (verdict: Runtime Error):
#最小公倍数を求める
import math

(A,B) = map(int,input().split(" "))
ans = (A * B) // math.gcd(A, B)
print(ans)


Fixed submission:
#最小公倍数を求める

(A,B) = map(int,input().split(" "))

m=max(A,B)
n=min(A,B)
while m%n != 0:
    temp = n
    n = m%n
    m = temp


print(A*B // n)

Buggy python submission (verdict: Runtime Error):
#最小公倍数を求める
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
    
(A,B) = input().split(" ")

print(lcm(int(A),int(B)))


Fixed submission:
#最小公倍数を求める

(A,B) = map(int,input().split(" "))

m=max(A,B)
n=min(A,B)
while m%n != 0:
    temp = n
    n = m%n
    m = temp


print(A*B // n)

Buggy python submission (verdict: Runtime Error):
#最小公倍数を求める
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
    
(A,B) = input().split(" ")

print(lcm(int(A),int(B)))


Fixed submission:
#最小公倍数を求める

(A,B) = map(int,input().split(" "))

m=max(A,B)
n=min(A,B)
while m%n != 0:
    temp = n
    n = m%n
    m = temp


print(A*B // n)
Buggy python submission (verdict: Time Limit Exceeded):
'''
AtCoder Grand Contest 030
A - Poisonous Cookies
'''


def main():
    a, b, c = map(int, input().split())
    oishii = b + c

    # クッキーを食べる
    while a + b > 0:

        c = c - 1 if c > 0 else 0

        if b > 0:
            b -= 1
        elif a > 0:
            a -= 1

    # まだcが残ってるなら一枚食べれる
    if c > 0:
        c -= 1

    print(oishii - (b + c))


if __name__ == "__main__":
    main()


Fixed submission:
'''
AtCoder Grand Contest 030
A - Poisonous Cookies
'''


def main():
    a, b, c = map(int, input().split())

    '''
    A + B + 1 ≥ C ならすべての毒入りの
    クッキーを食べることができるので B + C。
    そうでないなら答えはB + (A + B + 1) 。
    ※「+1」は最後にCを食べるので
    '''
    print(b + min(c, a + b + 1))


if __name__ == "__main__":
    main()