Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
ch=input()
if n%2==1:
    print('No')
else:
    if ch[:n//2]==ch[n//2:]:
        print('Yes')
    else:
        print('No')

Fixed submission:
n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')

Buggy python submission (verdict: Runtime Error):
numberinput= int(raw_input())
letterinput= raw_input()
if numberinput%2==1:
	print("No")
else:
  	if letterinput[:len(letterinput)//2]==letterinput[len(letterinput)//2:]
    	print("Yes")
    else:
        print("No)      

Fixed submission:
n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')

Buggy python submission (verdict: Runtime Error):

ch=input()

if ch[:n//2]==ch[n//2:]:
  print('Yes')
else:
   print('No')

Fixed submission:
n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')

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

letters=[]
for letter in word:
    letters.append(letters)
letters1= letters[:len(letters)//2]
letters2= letters[len(letters)//2:]
  
if letters1==letters2:
	return print(Yes)
else:
  	return print(No)

Fixed submission:
n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')

Buggy python submission (verdict: Runtime Error):
for letter in listofentries[1]:
    letters.append(letters)
letters1= letters[:len(letters)//2]
letters2= letters[len(letters)//2:]
  
if letters1==letters2:
	return print(Yes)
else:
  	return print(No)

Fixed submission:
n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')

Buggy python submission (verdict: Runtime Error):

for letter in listofentries[1]:
    letters.append(letters)
numbertoindex= listofentries[0]/2-1
 
for index in range(numbertoindex):
	letters1.append(index)
for index in range(numberofindex, listofentries[0]-1)
	letters2.append(index)
  
if letters1==letters2:
	return print(Yes)
else:
  	return print(No)

Fixed submission:
n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')

Buggy python submission (verdict: Runtime Error):
listofentries=input().split()
letters=[]
letters1=[]
letters2=[]
if listofentries[0]%2==1:
	return No
else:
	for letter in listofentries[1]:
    	letters.append(letters)
numbertoindex= listofentries[0]/2-1

for index in range(numbertoindex):
	letters1.append(index)
for index in range(numberofindex, listofentries[0]-1)
	letters2.append(index)
  
if letters1==letters2:
	return Yes

      


Fixed submission:
n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

import re

regxp = '^' + S + '.'

repattern = re.compile(regxp)
result = repattern.search(T)

# print(result.group())

if result.group() == T:
	print('Yes')
else:
	print('No')

Fixed submission:
S = input()
T = input()

import re

regxp = '^' + S + '.'

repattern = re.compile(regxp)
result = repattern.search(T)

# print(result.group())

try:
	if result.group() == T:
		print('Yes')
	else:
		print('No')
except:
	print('No')
Buggy python submission (verdict: Runtime Error):
M, D = map(int, input().split())

result = 0

if D < 22:
    print(0)
else:
    for m in range(1, M+1):
        for d in range(22, D+1):
            d1 = d%10
            d10 = d//10
            if d1 > 1 and d1*d10 == m:
                result += 1
	print(result)

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

result = 0

if D < 22:
    print(0)
else:
    for m in range(1, M+1):
        for d in range(22, D+1):
            d1 = d%10
            d10 = d//10
            if d1 > 1 and d1*d10 == m:
                result += 1
    print(result)
Buggy python submission (verdict: Runtime Error):
N, Q = map(int, input().split())
edges = [input().split() for _ in range(N-1)]
operations = [input().split() for _ in range(Q)]

tree = {}
counter = [0]*N
result = [0]*N
numbers = []

for o in operations:
    counter[int(o[0])-1] += int(o[1])

result[0] = counter[0]

# print(counter)

for e in edges:
    parent = e[0]
    sun = e[1]
    if sun in numbers:
        sun = e[0]
        parent = e[1]
    else:
        numbers.append(sun)

    if sun in tree:
        tree[sun].append(parent)
    else:
        tree[sun] = [parent]

    if parent in tree:
        tree[sun].extend(tree[parent])


# print(tree)

for k in tree.keys():
    result[int(k)-1] += counter[int(k) - 1]
    for i in tree[k]:
        result[int(k)-1] += counter[int(i)-1]

print(' '.join(map(str, result)))

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
prev = ''
K = []

while len(S) > 0:
    text = S.pop(0)
    K.append(text)
    while text == prev:
        if len(S) == 0:
            text = prev + text
            K.pop(-1)
        else:
            text += S.pop(0)
    prev = text
    K[-1] = text

print(len(K))

Fixed submission:
S = input()
prev = ''
K = ['']

i = 0

while i < len(S):
    text = S[i]
    prev = K[-1]
    if text == prev:
        if len(S) == i+1:
            K[-1] += text
            break
        else:
            j = i
            i += len(prev)
            text = S[j:i+1]
    K.append(text)
    i += 1

# print(K)
print(len(K)-1)

Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
prev = ''
K = []

while len(S) > 0:
    text = S.pop(0)
    K.append(text)
    while text == prev:
        if len(S) == 0:
            text = prev + text
            K.pop(-1)
        else:
            text += S.pop(0)
    prev = text
    K[-1] = text

print(len(K))

Fixed submission:
S = input()
prev = ''
K = ['']

i = 0

while i < len(S):
    text = S[i]
    prev = K[-1]
    if text == prev:
        if len(S) == i+1:
            K[-1] += text
            break
        else:
            j = i
            i += len(prev)
            text = S[j:i+1]
    K.append(text)
    i += 1

# print(K)
print(len(K)-1)
Buggy python submission (verdict: Runtime Error):
S = input()
n = len(S)
mod = 10**9+7
dp = [[0]*13 for _ in range(n+1)]
dp[0][0] = 1

for i in range(n):
    if S[i] == '?':
        for num in range(10):
            for j in range(13):
                dp[i+1][(j*10+num)%13] += dp[i][j]
    else:
        num = int(S[i])
        for j in range(13):
            dp[i + 1][(j * 10 + num) % 13] += dp[i][j]

    for j in range(13):
        dp[i + 1][j] %= mod

print(dp[n][5])

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

if (B-A)%2 == 0:
    print(int(A+(B-A)/2))
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
n = len(S)
mod = 10**9+7
dp = [[0]*13 for _ in range(n+1)]
dp[0][0] = 1

for i in range(n):
    if S[i] == '?':
        for num in range(10):
            for j in range(13):
                dp[i+1][(j*10+num)%13] += dp[i][j]
    else:
        num = int(S[i])
        for j in range(13):
            dp[i + 1][(j * 10 + num) % 13] += dp[i][j]

    for j in range(13):
        dp[i + 1][j] %= mod

print(dp[n][5])

Fixed submission:
S = input()
n = len(S)
mod = 10**9+7
dp = [[0]*13 for _ in range(n+1)]
dp[0][0] = 1

for i in range(n):
    if S[i] == '?':
        for num in range(10):
            for j in range(13):
                dp[i+1][(j*10+num)%13] += dp[i][j]
    else:
        num = int(S[i])
        for j in range(13):
            dp[i + 1][(j * 10 + num) % 13] += dp[i][j]

    for j in range(13):
        dp[i + 1][j] %= mod

print(dp[n][5])
Buggy python submission (verdict: Runtime Error):
S = int(input())

for i in range(int(S**0.5)+1, 1, -1):
    if S%i == 0:
        y = i
        break

x = int(S//y)

print(*[0, 0, 0, y, x, 0])



Fixed submission:
S = int(input())

v = 10**9

x = (v-S%v)%v
y = int((S+x)/v)

print(*[0, 0, v, 1, x, y])
Buggy python submission (verdict: Runtime Error):
N = int(input())
As = [int(input()) for i in range(N)]

for a in As:
    print(max([i for i in As if i != a]))

Fixed submission:
N = int(input())
As = [int(input()) for i in range(N)]

maxim = max(As)
counter = As.count(maxim)

if counter > 1:
    for a in As:
        print(maxim)
else:
    for a in As:
        if a == maxim:
            print(max([i for i in As if i != a]))
        else:
            print(maxim)
Buggy python submission (verdict: Runtime Error):
N = int(input())
aN = [ int(i) for i in input().split() ]
aN.reverse()
bN = []

for a in aN:
    if len([b for b in bN if b%N == 0])%2 == a:
        pass
    else:
        bN.append(N)
    N -= 1

print(len(bN))
print(' '.join(bN))

Fixed submission:
N = int(input())
aN = [ int(i) for i in input().split() ]
bN = [0] * N

for i in range(N, 0, -1):
    if sum(bN[i-1: :i]) % 2 != aN[i - 1]:
        bN[i-1] = 1

print(sum(bN))
if sum(bN) != 0:
    print(*[i+1 for i, b in enumerate(bN) if b == 1])
Buggy python submission (verdict: Runtime Error):
N = input()
nums = list(map(int, input().split()))

first = None
start = nums[0]
next = None

for num in nums:
    if start ^ num in nums:
        next = num
        first = start

if next == None:
    print("No")
else:
    while len(nums) > 1:
        next2 = start ^ next
        if next2 in nums:
            nums.remove(start)
            nums.remove(next)
            start = next
            next = next2
        else:
            print("No")
            break

    if len(nums) <= 1:
        if start ^ next == first:
            print("Yes")
        else:
            print("No")


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

result = 0

for num in nums:
    result ^= num

if result == 0:
    print('Yes')
else:
    print('No')

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

first = None
start = nums[0]
next = None

lists = nums[:]
for index, num in enumerate(lists):
    lists.pop(index)
    if start ^ num in lists:
        next = num
        first = start

# print(start, next)

if next == None:
    print("No")
else:
    while len(nums) > 1:
        if start ^ next in nums:
            nums.remove(start)
            nums.remove(next)
            next2 = start ^ next
            start = next
            next = next2
            # print(nums)
            # print(start, next)
        else:
            print("No")
            break

    if len(nums) <= 1:
        if start ^ next == first:
            print("Yes")  
        else:
            print("No")


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

result = 0

for num in nums:
    result ^= num

if result == 0:
    print('Yes')
else:
    print('No')

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

first = None
start = nums[0]
next = None

lists = nums[:]
for index, num in enumerate(lists):
    lists.pop(index)
    if start ^ num in lists:
        next = num
        first = start

# print(start, next)

if next == None:
    print("No")
else:
    while len(nums) > 1:
        if start ^ next in nums:
            nums.remove(start)
            nums.remove(next)
            next2 = start ^ next
            start = next
            next = next2
            # print(nums)
            # print(start, next)
        else:
            print("No")
            break

    if len(nums) <= 1:
        if start ^ next == first:
            print("Yes")  
        else:
            print("No")


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

result = 0

for num in nums:
    result ^= num

if result == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = [int(i) for i in list(input().split())]

result = []

length = len(As)
for i in range(length):
	res = 0
	for j in range(length):
		if (i+j)%2 == 0:
			res += As[(i+j)%length]
		else:
			res -= As[(i+j)%length]
	result.append(str(abs(res)))

print(" ".join(result))

Fixed submission:
N = int(input())
As = [int(i) for i in list(input().split())]

result = []

length = len(As)
before_res = 0
for i in range(length):
	res = 0
	if i == 0:
		for j in range(length):
			if (i+j)%2 == 0:
				res += As[(i+j)%length]
			else:
				res -= As[(i+j)%length]
	else:
		res = 2*As[(i-1)%length] - before_res
	before_res = res
	result.append(str(abs(res)))

print(" ".join(result))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = [int(i) for i in list(input().split())]

result = []

length = len(As)
for i in range(length):
	res = 0
	for j in range(length):
		if (i+j)%2 == 0:
			res += As[(i+j)%length]
		else:
			res -= As[(i+j)%length]
	result.append(str(abs(res)))

print(" ".join(result))

Fixed submission:
N = int(input())
As = [int(i) for i in list(input().split())]

result = []

length = len(As)
before_res = 0
for i in range(length):
	res = 0
	if i == 0:
		for j in range(length):
			if (i+j)%2 == 0:
				res += As[(i+j)%length]
			else:
				res -= As[(i+j)%length]
	else:
		res = 2*As[(i-1)%length] - before_res
	before_res = res
	result.append(str(abs(res)))

print(" ".join(result))
Buggy python submission (verdict: Runtime Error):
text = input()

if len(text) > 0:
	text1 = text.replace(text[0], "")
	text2 = text1.replace(text1[0], "")

	if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
	  print("Yes")
	else:
	  print("No")
else:
	print("No")


Fixed submission:
text = input()

text1 = text.replace(text[0], "")
try:
	text2 = text1.replace(text1[0], "")
except:
	text2 = "e"

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
text = input()

text1 = text.replace(text[0], "")
text2 = text1.replace(text1[0], "")

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
text = input()

text1 = text.replace(text[0], "")
try:
	text2 = text1.replace(text1[0], "")
except:
	text2 = "e"

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
text = input()

text1 = text.strip(text[0])
text2 = text1.strip(text1[0])

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
text = input()

text1 = text.replace(text[0], "")
try:
	text2 = text1.replace(text1[0], "")
except:
	text2 = "e"

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
text = input()

if len(text) == 4:
	text = text.strip(text[0])
	if len(text) == 2:  
		text = text.strip(text[0])
		if len(text) == 0:
  			print("Yes")
		else:
  			print("No")
	else:
      print("No")
else:
 	print("No")


Fixed submission:
text = input()

text1 = text.replace(text[0], "")
try:
	text2 = text1.replace(text1[0], "")
except:
	text2 = "e"

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
text = input()

text = text.strip(text[0])
text = text.strip(text[0])

if len(text) == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
text = input()

text1 = text.replace(text[0], "")
try:
	text2 = text1.replace(text1[0], "")
except:
	text2 = "e"

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
text = list(input())

list = {}

for t in text:
  if text.count(t) != 2:
    continue
  if t in list:
    list[t] += 1
  else:
    list[t] == 1
    
if len(list) == 2:
  return Yes
else:
  return No

Fixed submission:
text = input()

text1 = text.replace(text[0], "")
try:
	text2 = text1.replace(text1[0], "")
except:
	text2 = "e"

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math

n, k = input().split()
n = int(n)
k = int(k)
m = n - k

for i in range(1, k+1):
	if m + 1 < i:
		red_order = 0
	else:
		red_order = int(math.factorial(m + 1) / (math.factorial(m + 1 - i) * math.factorial(i)))
	blue_order = int(math.factorial(k - 1) / (math.factorial(k - 1 - (i - 1)) * math.factorial(i - 1)))
	print(red_order*blue_order%(10**9+7))

Fixed submission:
import math

N, K = input().split()
N = int(N)
K = int(K)
m = N - K
mod = 10**9+7

def factorial_m(N: int, M: int):
	res = 1
	for i in range(2, N+1):
		res *= i
		res %= M
	return res

def nCr(n, r, mod):
	if n == r:
		return 1
	elif r > n:
		return 0
	return (factorial_m(n, mod) * pow((factorial_m(n-r, mod) * factorial_m(r, mod)), mod-2, mod)) % mod

for i in range(1, K+1):
	print(nCr(N-K+1, i, mod) * nCr(K-1, i-1, mod) % mod)

Buggy python submission (verdict: Runtime Error):
import math

n, k = input().split()
n = int(n)
k = int(k)

for i in range(1, k+1):
	red_order = int(math.factorial(n - k + 1) / (math.factorial(n - k + 1 - i) * math.factorial(i)))
	blue_order = int(math.factorial(k - 1) / (math.factorial(k - 1 - (i - 1)) * math.factorial(i - 1)))
	# print(red_order, blue_order)
	print(red_order*blue_order%1000000007)

Fixed submission:
import math

N, K = input().split()
N = int(N)
K = int(K)
m = N - K
mod = 10**9+7

def factorial_m(N: int, M: int):
	res = 1
	for i in range(2, N+1):
		res *= i
		res %= M
	return res

def nCr(n, r, mod):
	if n == r:
		return 1
	elif r > n:
		return 0
	return (factorial_m(n, mod) * pow((factorial_m(n-r, mod) * factorial_m(r, mod)), mod-2, mod)) % mod

for i in range(1, K+1):
	print(nCr(N-K+1, i, mod) * nCr(K-1, i-1, mod) % mod)

Buggy python submission (verdict: Runtime Error):
import math

n, k = input().split()
n = int(n)
k = int(k)

for i in range(1, k+1):
	red_order = math.factorial(n - k + 1) / (math.factorial(n - k + 1 - i) * math.factorial(i))
	blue_order = math.factorial(k - 1) / (math.factorial(k - 1 - (i - 1)) * math.factorial(i - 1))
	print(int(red_order*blue_order%1000000007))

Fixed submission:
import math

N, K = input().split()
N = int(N)
K = int(K)
m = N - K
mod = 10**9+7

def factorial_m(N: int, M: int):
	res = 1
	for i in range(2, N+1):
		res *= i
		res %= M
	return res

def nCr(n, r, mod):
	if n == r:
		return 1
	elif r > n:
		return 0
	return (factorial_m(n, mod) * pow((factorial_m(n-r, mod) * factorial_m(r, mod)), mod-2, mod)) % mod

for i in range(1, K+1):
	print(nCr(N-K+1, i, mod) * nCr(K-1, i-1, mod) % mod)
Buggy python submission (verdict: Runtime Error):
x = input().split()[1]

ls = [int(n) for n in input().split()]

for index in range(len(ls)):
	list = ls[0:index]
	if sum(list) > x:
		print(index)
		break
	elif sum(list) == x:
		print(index + 1)
		break

Fixed submission:
x = int(input().split()[1])

ls = [int(n) for n in input().split()]

for index in range(len(ls)):
	list = ls[0:index]
	if sum(list) > x:
		print(index)
		break
	elif sum(list) == x:
		print(index + 1)
		break

	if index == len(ls) - 1:
		print(len(ls) + 1)
Buggy python submission (verdict: Runtime Error):
S, W = int(input().split())
if S < W:
    print('unsafe')
else:
    print('safe')

Fixed submission:
s,w=map(int,input().split())
 
if s>w:
	print("safe\n")
else:
	print("unsafe\n")
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
while K >=1:
    if A >= 1:
        A = A - 1
    elif B >= 1:
        B = B - 1
    K = K -1
print(A, B)

Fixed submission:
s, t = input().split()
print(t+s)

Buggy python submission (verdict: Runtime Error):
s = input() 
t = input()

print(t + s)

Fixed submission:
s, t = input().split()
print(t+s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
r = []
g = []
b = []
for i, x in enumerate(s):
  if x == 'R':
    r.append(i)
  elif x == 'G':
    g.append(i)
  else:
    b.append(i)
ans = 0
for i in r:
  for j in g:
    for k in b:
      if abs(i - j) != abs(j - k) and abs(j - k) != abs(k - i) and abs(k - i) != abs(i - j):
        ans += 1
print(ans)

Fixed submission:
n = int(input())
s = input()
ans = s.count('R') * s.count('G') * s.count('B')
for i in range(n - 2):
  for j in range(1, (n - i + 1) // 2):
    if s[i] != s[i+j] and s[i+j] != s[i+j*2] and s[i+j*2] != s[i]:
      ans -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
rev = False
for i in range(q):
  inp = input()
  if int(inp[0]) == 1:
    rev = not rev
  else:
    t, f, c = inp.split()
    if (int(f) == 1 and rev) or (int(f) == 2 and not rev):
      s += c
    else:
      s = c + s
print(s[::-1] if rev else s)


Fixed submission:
s = input()
q = int(input())
rev = False
pre = ''
for i in range(q):
  inp = input()
  if int(inp[0]) == 1:
    rev = not rev
  else:
    t, f, c = inp.split()
    if (int(f) == 1 and rev) or (int(f) == 2 and not rev):
      s += c
    else:
      pre += c
print(s[::-1] + pre if rev else pre[::-1] + s)

Buggy python submission (verdict: Runtime Error):
s = input()
q = int(input)
rev = False
for i in range(q):
  inp = input()
  if int(inp[0]) == 1:
    rev = not rev
  else:
    t, f, c = inp.split()
    if (int(f) == 1 and rev) or (int(f) == 2 and not rev):
      s += c
    else:
      s = c + s
print(reversed(s) if rev else s)

Fixed submission:
s = input()
q = int(input())
rev = False
pre = ''
for i in range(q):
  inp = input()
  if int(inp[0]) == 1:
    rev = not rev
  else:
    t, f, c = inp.split()
    if (int(f) == 1 and rev) or (int(f) == 2 and not rev):
      s += c
    else:
      pre += c
print(s[::-1] + pre if rev else pre[::-1] + s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
lst = []
for x in a:
  if x in lst:
    print('NO')
    break
  lst.append(x)
else:
  print('YES')
  


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lst = []
if len(set(a)) != len(a):
  print('NO')
else:
  print('YES')
Buggy python submission (verdict: Runtime Error):
n = input()
s, t = input().split()
ans = ''
for i in range(n):
  ans += s[i] + t[i]
print(ans)

Fixed submission:
n = int(input())
s, t = input().split()
ans = ''
for i in range(n):
  ans += s[i] + t[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
x, y = map(int, input().split())
print((x * y) // math.gcd(x, y))


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

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

Fixed submission:
from fractions import gcd
x, y = map(int, input().split())
print((x * y) // gcd(x, y))
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n % 2 != 0:
  print(0)
else:
  while n:
    ans += n
  print(n)

Fixed submission:
n = int(input())
if n % 2 != 0:
  print(0)
else:
  ans = 0
  while n:
    n //= 5
    ans += n // 2
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
mod = 10 ** 9 + 7

n = int(input())
a = np.asarray(list(map(int, input().split())))
ans = 0
bit = 1
for i in range(60):
  n_one = sum(a & 1)
  ans += n_one * (n - n_one) * bit
  a >>= 1
  bit *= 2
  ans %= mod
  bit %= mod
print(ans)

Fixed submission:
import numpy as np
mod = 10 ** 9 + 7

n = int(input())
a = np.asarray(list(map(int, input().split())))
ans = 0
bit = 1
for i in range(60):
  n_one = np.count_nonzero(a & 1)
  ans += n_one * (n - n_one) * bit
  a >>= 1
  bit *= 2
  ans %= mod
  bit %= mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
tmp = [a[0]]
for i in range(1, n):
  if sum(tmp) > sum(a) / 2:
    break
  tmp.append(a[i])
print(min(sum(tmp) * 2 - sum(a), sum(a) - sum(tmp[:-1]) * 2))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sm = sum(a)
tmp = a[0]
for i in range(1, n):
  if tmp > sm / 2:
    print(min(tmp * 2 - sm, sm - (tmp - a[i-1]) * 2))
    break
  tmp += a[i]
else:
  print(sm - (tmp - a[i]) * 2)