Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
ans = a*b/math.gcd(a,b)
print(int(ans))

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数

Fixed submission:
import fractions
a,b = map(int,input().split())
ans = a*b/fractions.gcd(a,b)
print(int(ans))

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数

Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
ans = a*b/math.gcd(a,b)
print(ans)

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数

Fixed submission:
import fractions
a,b = map(int,input().split())
ans = a*b/fractions.gcd(a,b)
print(int(ans))

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
maximum_num = max(a,b)
flag = 1
def equal_divide(x):
    equal = 1
    if x%a==0:
        if x%b==0:
            equal=0
    return equal

while (flag):
    flag = equal_divide(maximum_num)
    maximum_num+=1
print(maximum_num-1)



Fixed submission:
import fractions
a,b = map(int,input().split())
ans = a*b/fractions.gcd(a,b)
print(int(ans))

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
##print(ord("A"))
n = int(input())
#n,k = map(int,input().split())
h = list(map(int,input().split()))	
ans = []

for i in range(1,n+1):
    #print(i)
    for j in range(n):
        
        if h[j] == i:
            ans.append(j+1)
#print(ans)
for i in range(len(ans)):
    print(ans[i],end=" ")



Fixed submission:
import itertools
##print(ord("A"))
n = int(input())
#n,k = map(int,input().split())
h = list(map(int,input().split()))	
ans = [0]*n
for i in range(n):
    ans[h[i]-1]= i+1
#print(ans)
for i in range(n):
    print(ans[i],end=" ")
"""
for i in range(1,n+1):
    #print(i)
    for j in range(n):
        
        if h[j] == i:
            ans.append(j+1)
#print(ans)
for i in range(len(ans)):
    print(ans[i],end=" ")
"""
Buggy python submission (verdict: Runtime Error):
import itertools
##print(ord("A"))
#n = int(input())
n,k,q = map(int,input().split())
#h = list(map(int,input().split()))	
ans_list=[input() for i in range(q)]
pnt_list = [k-q]*n
#print(pnt_list)
for i in range(q):

    pnt_list[int(ans_list[i])]+=1
#print(pnt_list)
for i in range(len(pnt_list)):
    if pnt_list[i]>0:
        print("Yes")
    else:
        print("No")
"""
for i in range(q):
    #print(pnt_list)
    for j in range(n):
    
        if ans_list[i]==str(j+1):
            pass
        else:
            pnt_list[j]=pnt_list[j]-1
for i in range(len(pnt_list)):
    if pnt_list[i]>0:
        print("Yes")
    else:
        print("No")
#print(pnt_list)
"""

Fixed submission:
import itertools
##print(ord("A"))
#n = int(input())
n,k,q = map(int,input().split())
#h = list(map(int,input().split()))	
ans_list=[input() for i in range(q)]
pnt_list = [k-q]*n
#print(pnt_list)
for i in range(q):

    pnt_list[int(ans_list[i])-1]+=1
#print(pnt_list)
for i in range(len(pnt_list)):
    if pnt_list[i]>0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
##print(ord("A"))
#n = int(input())
n,k,q = map(int,input().split())
#h = list(map(int,input().split()))	
ans_list=[input() for i in range(q)]
pnt_list = [k]*n
#print(pnt_list)
for i in range(q):
    #print(pnt_list)
    for j in range(n):
    
        if ans_list[i]==str(j+1):
            pass
        else:
            pnt_list[j]=pnt_list[j]-1
for i in range(len(pnt_list)):
    if pnt_list[i]>0:
        print("Yes")
    else:
        print("No")
#print(pnt_list)

Fixed submission:
import itertools
##print(ord("A"))
#n = int(input())
n,k,q = map(int,input().split())
#h = list(map(int,input().split()))	
ans_list=[input() for i in range(q)]
pnt_list = [k-q]*n
#print(pnt_list)
for i in range(q):

    pnt_list[int(ans_list[i])-1]+=1
#print(pnt_list)
for i in range(len(pnt_list)):
    if pnt_list[i]>0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
maxi = max(a)
for i in range(n):
    if a[i] != maxi:
        print(maxi)
    else:
        b = a.pop(a[i])
        print(max(a))


Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
maxi = max(a)
s = sorted(a,reverse=True)

for i in range(n):
    if a[i] != maxi:
        print(maxi)
    else:
        print(s[1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
for i in range(n):
    b = a.pop(0)
    #print(a)
    print(max(a))
    a.append(b)
    #rint(a)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
maxi = max(a)
s = sorted(a,reverse=True)

for i in range(n):
    if a[i] != maxi:
        print(maxi)
    else:
        print(s[1])
Buggy python submission (verdict: Runtime Error):
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1

Fixed submission:
import statistics
import math
n = int(input()) 
s = list(map(int,input().split()))
s.sort()

med_ind = len(s)//2 -1
#print(med_ind)
ans = s[med_ind+1]-s[med_ind]
#print(s[med_ind+1],s[med_ind])
print(ans)
Buggy python submission (verdict: Runtime Error):

import fractions
a,b,c,d = map(int,input().split())	
lcm = c * d // fractions.gcd(c, d)
#print(lcm)
def divisor(x):
	
	x_c = fractions.floor(x/c)
	x_d = fractions.floor(x/d)
	#print(x_c,x_d)
	x_lcm = fractions.floor(x/lcm)
	#print(x_c,x_d,x_lcm)
	return x-x_c-x_d+x_lcm
#print(divisor(b),divisor(a))
ans = divisor(b)-divisor(a-1)
print(ans)

Fixed submission:

import fractions
a,b,c,d = map(int,input().split())	
lcm = c * d // fractions.gcd(c, d)
#print(lcm)
def divisor(x):
	
	x_c = x//c
	x_d = x//d
	#print(x_c,x_d)
	x_lcm = x//lcm
	#print(x_c,x_d,x_lcm)
	return x-x_c-x_d+x_lcm
#print(divisor(b),divisor(a))
ans = divisor(b)-divisor(a-1)
print(ans)

Buggy python submission (verdict: Runtime Error):

import math
a,b,c,d = map(int,input().split())	
lcm = c * d // math.gcd(c, d)
#print(lcm)
def divisor(x):
	
	x_c = math.floor(x/c)
	x_d = math.floor(x/d)
	#print(x_c,x_d)
	x_lcm = math.floor(x/lcm)
	#print(x_c,x_d,x_lcm)
	return x-x_c-x_d+x_lcm
#print(divisor(b),divisor(a))
ans = divisor(b)-divisor(a-1)
print(ans)

Fixed submission:

import fractions
a,b,c,d = map(int,input().split())	
lcm = c * d // fractions.gcd(c, d)
#print(lcm)
def divisor(x):
	
	x_c = x//c
	x_d = x//d
	#print(x_c,x_d)
	x_lcm = x//lcm
	#print(x_c,x_d,x_lcm)
	return x-x_c-x_d+x_lcm
#print(divisor(b),divisor(a))
ans = divisor(b)-divisor(a-1)
print(ans)

Buggy python submission (verdict: Runtime Error):
import statistics
import math
a,b,c,d = map(int,input().split())	
lcm = c * d // math.gcd(c, d)
#print(lcm)
def divisor(x):
	
	x_c = math.floor(x/c)
	x_d = math.floor(x/d)
	#print(x_c,x_d)
	x_lcm = math.floor(x/lcm)
	#print(x_c,x_d,x_lcm)
	return x-x_c-x_d+x_lcm
#print(divisor(b),divisor(a))
ans = divisor(b)-divisor(a-1)
print(ans)

Fixed submission:

import fractions
a,b,c,d = map(int,input().split())	
lcm = c * d // fractions.gcd(c, d)
#print(lcm)
def divisor(x):
	
	x_c = x//c
	x_d = x//d
	#print(x_c,x_d)
	x_lcm = x//lcm
	#print(x_c,x_d,x_lcm)
	return x-x_c-x_d+x_lcm
#print(divisor(b),divisor(a))
ans = divisor(b)-divisor(a-1)
print(ans)

Buggy python submission (verdict: Runtime Error):
import statistics
import math
a,b,c,d = map(int,input().split())	
lcm = c * d // math.gcd(c, d)
#print(lcm)
def divisor(x):
	
	x_c = math.floor(x/c)
	x_d = math.floor(x/d)
	#print(x_c,x_d)
	x_lcm = math.floor(x/lcm)
	#print(x_c,x_d,x_lcm)
	return x-x_c-x_d+x_lcm
#print(divisor(b),divisor(a))
ans = divisor(b)-divisor(a-1)
print(ans)

Fixed submission:

import fractions
a,b,c,d = map(int,input().split())	
lcm = c * d // fractions.gcd(c, d)
#print(lcm)
def divisor(x):
	
	x_c = x//c
	x_d = x//d
	#print(x_c,x_d)
	x_lcm = x//lcm
	#print(x_c,x_d,x_lcm)
	return x-x_c-x_d+x_lcm
#print(divisor(b),divisor(a))
ans = divisor(b)-divisor(a-1)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
Answer_list = []

for i in list(S):
    num = ord(i)+N
    if num >= 65 || num =< 90:
        Answer_list.append(chr(num))
    elif num < 90:
        Answer_list.append(chr(num - 26)        
print(''.join(Answer_list))

Fixed submission:
N = int(input())
S = input()
Answer_list = []
for i in list(S):
    num = ord(i)+N
    if num >= 65 and num <= 90:
        Answer_list.append(chr(num))
    elif num > 90:
        Answer_list.append(chr(num - 26))
print(''.join(Answer_list))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int,input().split()))
count = []
for i in range(n):
    j = i
    count.append(0)
    while j < n -1 and h[j] >= h[j+1]:
        count[i] += 1
        j += 1
print(max(count))


Fixed submission:
n = int(input())
h = list(map(int,input().split()))
count = [0]*n
i = 0
while i < n:
    j = i
    while j < n -1 and h[j] >= h[j+1]:
        count[i] += 1
        j += 1
    i += count[i] + 1
print(max(count))
Buggy python submission (verdict: Runtime Error):

from collections import Counter

n = int(input())
s =  Counter("".join(sorted(input())) for i in range(n))

print(sum(map(lambda x : x * (x - 1) // 2, s.values())))


Fixed submission:
a,b=map(int,input().split())
print(max(a+b,max(a-b,a*b)))

Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s = Counter(''.join(sorted(input())) for i in range(n))#文字列をsortedした時点でlistになる
print(sum(map(lambda x : x * (x-1) // 2, s.values())))


Fixed submission:
a,b=map(int,input().split())
print(max(a+b,max(a-b,a*b)))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s = [sorted([*input()]) for i in range(n)] #[*(hogehoge)]で一文字ずつのリストに！
s2 = [''.join(s[i]) for i in range(n)] #sortのために一文字ごとに区切ってリストのにしたものを一単語に連結
s3 = Counter(s2[i] for i in range(n))#同じものを計数
#print(s2)
#print(s3)
#print(s3.values())

print(sum(map(lambda x : x*(x-1)//2, s3.values())))#lambda式は便利


Fixed submission:
from collections import Counter

n = int(input())
s =  Counter("".join(sorted(input())) for i in range(n))

print(sum(map(lambda x : x * (x - 1) // 2, s.values())))

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [sorted([*input()]) for k in range(n)] #[*(hogehoge)]で一文字ずつのリストに！
count=0
for i in range(n-1):
    for j in range(i+1,n):
        if s[i] == s[j]:
            count += 1
print(count)


Fixed submission:
from collections import Counter

n = int(input())
s =  Counter("".join(sorted(input())) for i in range(n))

print(sum(map(lambda x : x * (x - 1) // 2, s.values())))
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
taste=[]
all_taste = 0
for i in range(n):
    taste.append(l+i)
    all_taste += taste[i]
if taste[0] > 0 and taste[n-1] > 0:
    print(all_taste - tasete[0])
    exit()
elif taste[0] < 0 and taste[n-1] < 0:
    print(all_taste - taste[n-1])
    exit()
else:
    print(all_taste)


Fixed submission:
n,l=map(int,input().split())
taste=[]
all_taste = 0
for i in range(n):
    taste.append(l+i)
    all_taste += taste[i]
if taste[0] > 0:
    print(all_taste - taste[0])
    exit()
elif taste[n-1] < 0:
    print(all_taste - taste[n-1])
    exit()
else:
    print(all_taste)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input())
s=list(input())
s[k-1]=s[k-1].lower()
print(''.join(s))


Fixed submission:
n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print(''.join(s))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input())
s=list(input())
s[k-1]=s[k-1].lower()
print(''.join(s))

Fixed submission:
n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    while b != 0:
        a,b=b,a%b
    return a

n=int(input())
a=[0] + list(map(int,input().split())) + [0]#a[n+1]=0とするため

l=[0]*(n+2)
r=[0]*(n+2)#r[n+1]=0としたいから
for i in range(1,n+1):
    l[i] = gcd(l[i-1],a[i])
for i in range(n,0,-1):
    r[i] = gcd(r[i+1],a[i])

z=[gcd(l[i-1],r[i+1]) for i in range(1,n+1)]

print(max(z))


Fixed submission:
a,b,t = map(int,input().split())
print(b*(t//a))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a != b:
    ans = max(a,b) + max(a,b) - 1
else:
    ans = a*2:
print(ans)


Fixed submission:
a,b = map(int,input().split())
if a != b:
    ans = max(a,b) + max(a,b) - 1
else:
    ans = a*2
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
if a != b:
    ans = max(a,b) + max(a,b) - 1
else:
    ans = a*2:
print(ans)


Fixed submission:
a,b = map(int,input().split())
if a != b:
    ans = max(a,b) + max(a,b) - 1
else:
    ans = a*2
print(ans)
Buggy python submission (verdict: Runtime Error):
a=list(int(input()) for i in range(5))

b=[-(-a[i]//10)*10 for i in range(5)]
c=[a[i]%10 for i in range(5) if a[i]%10 != 0]

print(sum(b) + min(c) -10)


Fixed submission:
a=list(int(input()) for i in range(5))

b=[-(-a[i]//10)*10 for i in range(5)]
c=[a[i]%10 for i in range(5) if a[i]%10 != 0]

if c != []:
    print(sum(b) + min(c) -10)
else:
    print(sum(b))

Buggy python submission (verdict: Runtime Error):
a=list(int(input()) for i in range(5))

b=[-(-a[i]//10)*10 for i in range(5)]
c=[a[i]%10 for i in range(5) if a[i]%10 != 0]
print(b)

print(sum(b) + min(c) -10)


Fixed submission:
a=list(int(input()) for i in range(5))

b=[-(-a[i]//10)*10 for i in range(5)]
c=[a[i]%10 for i in range(5) if a[i]%10 != 0]

if c != []:
    print(sum(b) + min(c) -10)
else:
    print(sum(b))
Buggy python submission (verdict: Runtime Error):
A, B = int(input().split())
C = A*B
if C%2 == 0 :
  print(Even)
else : 
  print(Odd)

Fixed submission:
A, B = map(int,input().split())
C = A*B
if C%2 == 0 :
  print("Even")
else : 
  print("Odd")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
C = set(A)
B = [0]*N
i = 0
for a in C:
    B[i] += A.count(a)
    i += 1
B = [i%2 for i in B]
print(B.count(1))


Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]
B = {}
for i in A:
    if i not in B:
        B[i] = 1
    else:
        if B[i] == 1:
            B[i] -= 1
        else:
            B[i] += 1
cnt = 0
for j in B.keys():
    if B[j] == 1:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = []
for i in range(1,N):
    a = sum(A[:i])
    b = sum(A[i:])
    B.append(abs(a-b))
print(min(B))


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
sum_A = sum(A)
ans = 10**20
X = 0
for a in A[:-1]:
    X += a
    ans = min(ans,abs(sum_A-2*X))
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input.split())
print("YES" if b-a == c-b else "NO")

Fixed submission:
a,b,c = map(int,input().split())
print("YES" if b-a == c-b else "NO")
Buggy python submission (verdict: Runtime Error):
n,s=input().split()

print(s.count('ABC'))

Fixed submission:
n=input()
s=input()

print(s.count('ABC'))
Buggy python submission (verdict: Runtime Error):
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import bisect
import sys
import logging
import heapq
logging.basicConfig(level=logging.DEBUG)

input = sys.stdin.readline

setrecursionlimit(1000000)

MOD = 10**9+7

def main():
    A,B=[int(x) for x in input().split()]

    max_gcd=gcd([A,B])
    P=primes(max_gcd)
    ans=1 # 1
    for p in P:
        if A%p==0 and B%p==0:
            ans+=1
    print(ans)

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass

main()

Fixed submission:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import bisect
import sys
import logging
import heapq
logging.basicConfig(level=logging.DEBUG)

input = sys.stdin.readline

setrecursionlimit(1000000)

MOD = 10**9+7

def main():
    A,B=[int(x) for x in input().split()]

    max_gcd=gcd([A,B])
    P=prime_factor(max_gcd)
    P2=set(P)
    print(len(P2)+1)

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass

def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass #sortされていない

def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            ass.append(i)
            n = n//i
    if n != 1:
        ass.append(n)
    return ass

main()
Buggy python submission (verdict: Runtime Error):
S=input()
if S=="Sunny":
    print("Cloudy")
elif S=="Cloudy":
    print(Rainy)
elif S=="Rainy":
    print(Sunny)

Fixed submission:
S=input()
if S=="Sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
elif S=="Rainy":
    print("Sunny")
Buggy python submission (verdict: Runtime Error):
N=int(input())
l=list(range(1,N))
s=[0]*N
for i in range(N-1):
    s[i+1]=s[i]+l[i]
print(s[N-1])

Fixed submission:
N=int(input())
print(N*(N-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
M=0
for i in range(1,N+1):
    j=(i+1)%(N+1)
    if j==0:
        j=1
    # print(i,j,i%j)
    M+=i%j
print(M)

Fixed submission:
N=int(input())
print(N*(N-1)//2)

Buggy python submission (verdict: Runtime Error):
N=int(input())
l1=list(range(1,N+1))
#l2=sorted(l1,reverse=True)
l2=list(range(2,N+1))
l2.append(1)
M=0
for i in range(N):
    M+=l1[i]%l2[i]
print(M)

Fixed submission:
N=int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Runtime Error):
n,q=map(int,input().split())

# 隣接グラフ
to=[[] for i in range(n)] 
ans=[0 for i in range(n)]

# 深さ優先探索
def dfs(v, p=-1):
    global to,ans
    for u in to[v]:
        if u==p:
            continue
        ans[u]+=ans[v]
        dfs(u,v)

# 隣接グラフ作成
for _ in range(n-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    to[a].append(b)
    to[b].append(a)

for _ in range(q):
    p,x=map(int,input().split())
    p-=1
    ans[p]+=x

dfs(0)

for i in ans:
    print(i)

Fixed submission:
n,q=map(int,input().split())

# 隣接グラフ
to=[[] for i in range(n)] 
ans=[0 for i in range(n)]


# 深さ優先探索(再帰)
def dfs(v, p=-1):
    global ans
    for u in to[v]:
        if u==p:
            continue
        ans[u]+=ans[v]
        dfs(u,v)

# 深さ優先探索(ループ)
def dfs2():
    global ans
    queue=list()
    visit=dict()

    queue.append(0)
    for v in queue:
        visit.setdefault(v,True)
        for u in to[v]:
            if u in visit:
                continue
            ans[u]+=ans[v]
            queue.append(u)

# 隣接グラフ作成
for _ in range(n-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    to[a].append(b)
    to[b].append(a)

for _ in range(q):
    p,x=map(int,input().split())
    p-=1
    ans[p]+=x

#dfs(0)
dfs2()

for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
plus = a + b
minus = a - b
mult = a * b
ans = max(plus, minus)
ans = max(ans, mult)
print ans

Fixed submission:
a, b = map(int, input().split())
plus = a + b
minus = a - b
mult = a * b
ans = max(plus, minus)
ans = max(ans, mult)
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import exit,setrecursionlimit
input = sys.stdin.readline

setrecursionlimit(1000000)

def main():
    S=input()

    A=[0]*(len(S)-1)
    mode="L"
    s=0
    b=0
    e=0
    l=0
    for i in range(len(S)):
        c=S[i]
        if mode=="L" and c==mode:
            mode="R"
            b=i-1
        elif mode=="R" and c==mode:
            mode="L"
            e=i-1

            calc(A,s,b,e)
            
            s=i
        elif c=="\n":
            e=i-1
            calc(A,s,b,e)

    print(*A)

def calc(A, s, b, e):
    l=e-s+1

    A[b]=(b-s)//2+(e-b)//2+1
    A[b+1]=l-A[b]

main()

Fixed submission:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import bisect
import sys
import logging
import heapq
logging.basicConfig(level=logging.DEBUG)

input = sys.stdin.readline

setrecursionlimit(1000000)

def main():
    S=input()

    mode="L"
    start=0
    base=0
    end=0
    group=[]
    for i in range(len(S)):
        s=S[i]
        if mode=="L" and s==mode:
            mode="R"
            base=i-1
        elif mode=="R" and s==mode:
            mode="L"
            end=i-1
            group.append((start,base,end))
            start=i
        elif s=="\n":
            end=i-1
            group.append((start,base,end))
    # print(group)

    A=[0 for _ in range(len(S)-1)]
    for g in group:
        s=g[0]
        b=g[1]
        e=g[2]
        l=e-s+1
        if l//2==0:
            A[b]=A[b+1]=l/2
        else:
            A[b]=(b-s)//2+(e-b)//2+1
            A[b+1]=l-A[b]
    
    print(*A)

main()
Buggy python submission (verdict: Runtime Error):
M=1000005
s=int(input())

def f(n,i):
    if i==1:
        return s

    if n%2==0:
        return n//2
    else:
        return 3*n+1

A={}
n=0
for i in range(1,M):
    n=f(n,i)
    A.setdefault(i,n)
    for j in range(1,i):
        if A[j]==A[i]:
            print(i)
            return

Fixed submission:
M=1000005
s=int(input())

def f(n,i):
    if i==1:
        return s

    if n%2==0:
        return n//2
    else:
        return 3*n+1

A={}
n=0
for i in range(1,M):
    n=f(n,i)
    A.setdefault(i,n)
    for j in range(1,i):
        if A[j]==A[i]:
            print(i)
            exit()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np

n=int(sys.stdin.readline())
#n,k=map(int,sys.stdin.readline().split())
a=np.array(sys.stdin.readline().split(),dtype='int64')
#a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64')

for i in range(1,n+1):
    print(np.count_nonzero(a==i))


Fixed submission:
import sys
import numpy as np

n=int(sys.stdin.readline())
#n,k=map(int,sys.stdin.readline().split())
a=np.array(sys.stdin.readline().split(),dtype='int64')
#a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64')

ans=[0]*n
for i in range(n-1):
    ans[a[i]-1]+=1
for i in range(n):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
import sys,math
import numpy as np

n=int(sys.stdin.readline())
#n,k=map(int,sys.stdin.readline().split())
#a=np.array(sys.stdin.readline().split(),dtype='int64')
#a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64')
ans=0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=math.gcd(math.gcd(i,j),k)

print(ans)


Fixed submission:
import sys,math
import numpy as np

n=int(sys.stdin.readline())
#n,k=map(int,sys.stdin.readline().split())
#a=np.array(sys.stdin.readline().split(),dtype='int64')
#a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64')
ans=0
for i in range(1,n+1):
    ans+=i
    if i!=n:
        for j in range(i+1,n+1):
            f=math.gcd(i,j)
            ans+=f*6
            if j!=n:
                for k in range(j+1,n+1):
                    ans+=math.gcd(f,k)*6

print(ans)