Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b =list(map(int,input().split()))

c = 0

for i in range(a):
    if (b[i] - min(b[i:a]))>1:
      c+=1
      break
if c==0: print("Yes")
else: print("No")

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

c = 0

for i in range(a):
  if i>0:
    if (b[i] - b[i-1])<-1:
      c+=2
    if (b[i] - b[i-1])==-1:
      c+=1
    if (b[i] - b[i-1])>0:
      c=0
  if c>=2: break
if c<=1: print("Yes")
else: print("No")

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


c = 0

for i in range(a):
    if (b[i]-1)*(a-i)>=sum(b[i:a]):
      c+=1
      break
if c==0: print("Yes")
else: print("No")

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

c = 0

for i in range(a):
  if i>0:
    if (b[i] - b[i-1])<-1:
      c+=2
    if (b[i] - b[i-1])==-1:
      c+=1
    if (b[i] - b[i-1])>0:
      c=0
  if c>=2: break
if c<=1: print("Yes")
else: print("No")

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


c = 0

for i in range(a):
    if (int(b[i]) - int(min(b[i:a])))>1:
      c+=1
      break
if c==0: print("Yes")
else: print("No")

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

c = 0

for i in range(a):
  if i>0:
    if (b[i] - b[i-1])<-1:
      c+=2
    if (b[i] - b[i-1])==-1:
      c+=1
    if (b[i] - b[i-1])>0:
      c=0
  if c>=2: break
if c<=1: print("Yes")
else: print("No")

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


c = 0

for i in range(a):
  for j in range(i,a):
    if (int(b[i]) - int(b[j]))>1:
      c+=1
      break
  if c!=0: break

if c==0: print("Yes")
else: print("No")

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

c = 0

for i in range(a):
  if i>0:
    if (b[i] - b[i-1])<-1:
      c+=2
    if (b[i] - b[i-1])==-1:
      c+=1
    if (b[i] - b[i-1])>0:
      c=0
  if c>=2: break
if c<=1: print("Yes")
else: print("No")

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


c = 0

for i in range(a):
  for j in range(i,a):
      if (int(b[i]) - int(b[j]))>1:
          c=1
if c==1:
  print("No")
else:
  print("Yes")

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

c = 0

for i in range(a):
  if i>0:
    if (b[i] - b[i-1])<-1:
      c+=2
    if (b[i] - b[i-1])==-1:
      c+=1
    if (b[i] - b[i-1])>0:
      c=0
  if c>=2: break
if c<=1: print("Yes")
else: print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input().split()

b =[str(i+1) for i in range(len(s))]

count=0
for i in range(len(s)):
  if s[i]!=b[i]:
    count+=1
if count==0: print("YES")
elif count==2: print("YES")
else: print("NO")

Fixed submission:
a, b =map(int, input().split())
#A^2 -2AK-K^2=B^2 -2BK -K^2
#A^2-B^2=2(A-B)K

c = (a**2 -b**2)/(2*(a-b))
if c-int(c)!=0:
  print("IMPOSSIBLE")
else:
  print(int(c))
Buggy python submission (verdict: Runtime Error):
n, d = map(int,input().split())
print(math.ceil(n/(2*d+1)))

Fixed submission:
import math
n, d = map(int,input().split())
print(math.ceil(n/(2*d+1)))
Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())
mod1 = []
mod2 = []
for i in range(l,r+1):
  mod1.append(i%2019)

for i in range(len(mod1)-1):
  for j in range(i+1,len(mod1)):
    mod2.append((mod1[i]*mod1[j])%2019)
print(min(mod2))

Fixed submission:
a, b, c =map(int,input().split())
if a*b>=c:
  print(c)
else:
  print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())
mod1 = []
mod2 = []
for i in range(l,r+1):
  mod1.append(i%2019)
#print(mod1)
if min(mod1)==0:
  print(0)
else:
  for i in range(len(mod1)-1):
    for j in range(i+1,len(mod1)):
      mod2.append((mod1[i]*mod1[j])%2019)
	#print(mod2)
  print(min(mod2))


Fixed submission:
l, r = map(int, input().split())
mod1 = []
mod2 = []
cccc=0
for i in range(l,r+1):
  b=i%2019
  mod1.append(b)
  if b==0:
    cccc=1
    break
#print(mod1)
if cccc==1:
  print(0)
else:
  for i in range(len(mod1)-1):
    for j in range(i+1,len(mod1)):
      mod2.append((mod1[i]*mod1[j])%2019)
	#print(mod2)
  print(min(mod2))

Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())
mod1 = []
mod2 = []
for i in range(l,r+1):
  mod1.append(i%2019)

for i in range(len(mod1)-1):
  for j in range(i+1,len(mod1)):
    mod2.append((mod1[i]*mod1[j])%2019)

print(min(mod2))

Fixed submission:
l, r = map(int, input().split())
mod1 = []
mod2 = []
cccc=0
for i in range(l,r+1):
  b=i%2019
  mod1.append(b)
  if b==0:
    cccc=1
    break
#print(mod1)
if cccc==1:
  print(0)
else:
  for i in range(len(mod1)-1):
    for j in range(i+1,len(mod1)):
      mod2.append((mod1[i]*mod1[j])%2019)
	#print(mod2)
  print(min(mod2))
Buggy python submission (verdict: Runtime Error):
w, h, x, y = map(int,input().split())
area=w*h/2
awee=0
if x==w/2 or y==h/2:
    awee=0
    if x==w/2 and y==h/2:
        awee=1
else:
    awee=0

print(str(area)+" "+str(awee))

Fixed submission:
x, a = map(int,input().split())
print(0) if x<a else print(10)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = set(int(input()) for _ in range(m))
#for i in range(m):
#  a.append(int(input()))
b=[0 for x in range(n+1)]
b[0]=1
for i in range(1,n+1):
  if i in a:
    continue
  x=b[i-1]
  if i>1:x+=b[i-2]
  b[i]=x
print(b[n]%(10**9+7))

Fixed submission:
print(sum(sorted(list(map(int,input().split())))[:2]))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
for i in range(m):
  a.append(int(input()))
b=[0 for x in range(n+1)]
b[0]=1
for i in range(1,n+1):
  if i in a:
    b[i]=0
  else:
    b[i]+=b[i-1]
    if i>1:b[i]+=b[i-2]
print(b[n]%=(10**9+7))

Fixed submission:
print(sum(sorted(list(map(int,input().split())))[:2]))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>=13:
  print(b)
elif a<13 and a>=6
  print(b//2)
else:
  print(0)

Fixed submission:
a,b=map(int,input().split())
if a>=13:
  print(b)
elif a<13 and a>=6:
  print(b//2)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
a = [int(input()) for i in range 6]
print("Yay!" if a[4]-a[0]<=a[5] else ":(")

Fixed submission:
a = [int(input()) for i in range(6)]
print("Yay!" if a[4]-a[0]<=a[5] else ":(")
Buggy python submission (verdict: Runtime Error):
s = input()
print(s.translate(str.maketrans({"A":"T","T":"A","C":"G","G":"C"})

Fixed submission:
s = input()
print(s.translate(str.maketrans({"A":"T","T":"A","C":"G","G":"C"})))
Buggy python submission (verdict: Runtime Error):
def main():
    n, m, k = list(map(int, input().split()))
    a_books = list(map(int, input().split()))
    b_books = list(map(int, input().split()))

    sumbooks = sum(a_books) + sum(b_books)
    count = len(a_books) + len(b_books)
    if a_books[0] > k and b_books[0] > k:
        print(0)
        exit()
    elif sumbooks <= k:
        print(len(a_books) + len(b_books))
        exit()

    while sumbooks > k:
        if len(a_books) and a_books[-1] >= b_books[-1]:
            sumbooks -= a_books.pop(-1)
        elif len(b_books) and b_books[-1] >= a_books[-1]:
            sumbooks -= b_books.pop(-1)

        if sumbooks <= k:
            break
        count -= 1
    print(count)


if __name__ == '__main__':
    main()

Fixed submission:
def main2():
    n, m, k = list(map(int, input().split()))
    a_books = list(map(int, input().split()))
    b_books = list(map(int, input().split()))

    a, b = [0], [0]
    
    for i in range(len(a_books)):
        a.append(a[i] + a_books[i])

    for i in range(len(b_books)):
        b.append(b[i] + b_books[i])
    ans, j  = 0, len(b_books)
    
    for i in range(len(a)):
        if a[i] > k :
            break
        while b[j] > k - a[i]:
            j -= 1
        ans = max(ans, i+j)
    print(ans)


if __name__ == '__main__':
    main2()

Buggy python submission (verdict: Runtime Error):

def main():
    n, m, k = list(map(int, input().split()))
    a_books = list(map(int, input().split()))
    b_books = list(map(int, input().split()))

    sumbooks = sum(a_books) + sum(b_books)
    count = len(a_books) + len(b_books)
    if a_books[0] > k and b_books[0] > k:
        print(0)
        exit()
    elif sumbooks <= k:
        print(len(a_books) + len(b_books))
        exit()

    while sumbooks > k:
        if len(a_books) and a_books[-1] >= b_books[-1]:
            sumbooks -= a_books.pop(-1)
        elif len(b_books) and b_books[-1] >= a_books[-1]:
            sumbooks -= b_books.pop(-1)

        if sumbooks <= k:
            break
        count -= 1
    print(count)


if __name__ == '__main__':
    main()


Fixed submission:
def main2():
    n, m, k = list(map(int, input().split()))
    a_books = list(map(int, input().split()))
    b_books = list(map(int, input().split()))

    a, b = [0], [0]
    
    for i in range(len(a_books)):
        a.append(a[i] + a_books[i])

    for i in range(len(b_books)):
        b.append(b[i] + b_books[i])
    ans, j  = 0, len(b_books)
    
    for i in range(len(a)):
        if a[i] > k :
            break
        while b[j] > k - a[i]:
            j -= 1
        ans = max(ans, i+j)
    print(ans)


if __name__ == '__main__':
    main2()
Buggy python submission (verdict: Runtime Error):

def main():
    x,y = list(map(int, input().split()))

    if y == 0:
        print(x)
        exit()
    nums = list(map(int, input().split()))
    ans = []
    # 右へ進む
    for i in range(x, 101):
        if i not in nums:
           ans.append(i)
           break
    for i in range(x, 0, -1):
        if i not in nums:
           ans.append(i)
           break
    if len(ans) == 1:
        print(ans[0])
        exit()
    if abs(ans[0] - x) == abs(ans[1] - x):
        print(min(ans))
    elif abs(ans[0] - x) > abs(ans[1] - x):
        print(ans[1])
    elif abs(ans[0] - x) < abs(ans[1] - x):
        print(ans[0])

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    x,y = list(map(int, input().split()))

    if y == 0:
        print(x)
        exit()
    nums = list(map(int, input().split()))
    ans = 0
    for i in range(1, 200):
        if i not in nums:
            ans = ans if abs(ans-x) <= abs(i-x) else i
    print(ans)



if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):

def main():
    x,y = list(map(int, input().split()))

    if y == 0:
        print(x)
        exit()
    nums = list(map(int, input().split()))
    ans = []
    # 右へ進む
    for i in range(x, 101):
        if i not in nums:
           ans.append(i)
           break
    for i in range(x, 0, -1):
        if i not in nums:
           ans.append(i)
           break
    if len(ans) == 1:
        print(ans[0])
    if abs(ans[0] - x) == abs(ans[1] - x):
        print(min(ans))
    elif abs(ans[0] - x) > abs(ans[1] - x):
        print(ans[1])
    elif abs(ans[0] - x) < abs(ans[1] - x):
        print(ans[0])

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    x,y = list(map(int, input().split()))

    if y == 0:
        print(x)
        exit()
    nums = list(map(int, input().split()))
    ans = 0
    for i in range(1, 200):
        if i not in nums:
            ans = ans if abs(ans-x) <= abs(i-x) else i
    print(ans)



if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):

def main():
    x,y = list(map(int, input().split()))

    if y == 0:
        print(x)
        exit()
    nums = list(map(int, input().split()))
    ans = []
    # 右へ進む
    for i in range(x, 101):
        if i not in nums:
           ans.append(i)
           break
    for i in range(x, 0, -1):
        if i not in nums:
           ans.append(i)
           break
    if abs(ans[0] - x) == abs(ans[1] - x):
        print(min(ans))
    elif abs(ans[0] - x) > abs(ans[1] - x):
        print(ans[1])
    elif abs(ans[0] - x) < abs(ans[1] - x):
        print(ans[0])

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    x,y = list(map(int, input().split()))

    if y == 0:
        print(x)
        exit()
    nums = list(map(int, input().split()))
    ans = 0
    for i in range(1, 200):
        if i not in nums:
            ans = ans if abs(ans-x) <= abs(i-x) else i
    print(ans)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):

url = "https://atcoder.jp/contests/abc162/tasks/abc162_d"
import itertools


def main():
    n, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    route = []
    istuka = [0] * (n+1)
    next = 1
    # 同じ街に訪れるまでループ
    for _ in range(k):
        if istuka[next] == 1:
            break
        else:
            istuka[next] = 1
            route.append(next)
        next = a[next - 1]
    ans = route[route.index(next):]
    idx = (k - route.index(next)) % len(ans)
    print(ans[idx])



if __name__ == '__main__':
    main()

Fixed submission:

url = "https://atcoder.jp/contests/abc162/tasks/abc162_d"
import itertools


def main():
    n, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    route = []
    istuka = [0] * (n+1)
    next = 1
    # 同じ街に訪れるまでループ
    for _ in range(k):
        if istuka[next] == 1:
            break
        else:
            istuka[next] = 1
            route.append(next)
        next = a[next - 1]
    if n >= k:
        print(next)
        exit()
    ans = route[route.index(next):]
    idx = (k - route.index(next)) % len(ans)
    print(ans[idx])



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):

def main2():
    input()
    t = input()
    pat = []
    for i in range(len(t)):
        if t[i] == 'R':
            pat.append(0)
        if t[i] == 'G':
            pat.append(1)
        if t[i] == 'B':
            pat.append(2)
    count = 0
    for i in range(len(pat)):
        for j in range(i + 1, len(pat)):
            for k in range(j + 1, len(pat)):
                tmp = {pat[i], pat[k], pat[j]}
                if j - i != k - j and len(tmp) == 3:
                    count += 1
    print(count)


if __name__ == '__main__':
    main2()

Fixed submission:
def main3():
    n = int(input())
    s = input()

    ans = s.count("R") * s.count("B") * s.count("G")
    for i in range(n):
        for j in range(i, n):
            k = 2 * j - i
            if k >= n: break
            if s[i] != s[j] and s[j] != s[k] and s[i] != s[k]:
                ans -= 1

    print(ans)

if __name__ == '__main__':
    main3()

Buggy python submission (verdict: Time Limit Exceeded):
import itertools


def main():
    input()
    t = input()
    dic = {'R': [], 'G': [], 'B': []}
    for i in range(len(t)):
        dic[t[i]].append(i)
    count = 0
    p = itertools.product(dic['R'], dic['G'], dic['B'])
    for i in p:
        tmp = sorted(list(i))
        if tmp[1] - tmp[0] != tmp[2] - tmp[1]:
            count += 1

    print(count)

if __name__ == '__main__':
    main()

Fixed submission:
def main3():
    n = int(input())
    s = input()

    ans = s.count("R") * s.count("B") * s.count("G")
    for i in range(n):
        for j in range(i, n):
            k = 2 * j - i
            if k >= n: break
            if s[i] != s[j] and s[j] != s[k] and s[i] != s[k]:
                ans -= 1

    print(ans)

if __name__ == '__main__':
    main3()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    input()
    t = input()
    dic = {'R': [], 'G': [], 'B': []}
    for i in range(len(t)):
        dic[t[i]].append(i)
    count = 0
    for i in dic['R']:
        for j in dic['G']:
            for k in dic['B']:
                ids = sorted([i, j, k])
                if ids[1] - ids[0] != ids[2] - ids[1]:
                    count += 1
    print(count)

if __name__ == '__main__':
    main()

Fixed submission:
def main3():
    n = int(input())
    s = input()

    ans = s.count("R") * s.count("B") * s.count("G")
    for i in range(n):
        for j in range(i, n):
            k = 2 * j - i
            if k >= n: break
            if s[i] != s[j] and s[j] != s[k] and s[i] != s[k]:
                ans -= 1

    print(ans)

if __name__ == '__main__':
    main3()
Buggy python submission (verdict: Runtime Error):
url = "https://atcoder.jp/contests/abc161/tasks/abc161_b"

def main():
    n, m = list(map(int, input().split()))
    n_li = list(map(int, input().split()))
    n_li = sorted(n_li, reverse=True)
    all = sum(n_li)
    for i in range(1, m + 1):
        if all // (4 * m) > n_li[i]:
            print('No')
            exit()
    print('Yes')


if __name__ == '__main__':
    main()




Fixed submission:
url = "https://atcoder.jp/contests/abc161/tasks/abc161_b"


def main():
    n, m = list(map(int, input().split()))
    n_li = list(map(int, input().split()))
    n_li = sorted(n_li, reverse=True)
    all_num = sum(n_li)
    for i in range(1, m + 1):
        if all_num / (4 * m) > n_li[i - 1]:
            print('No')
            exit()
    print('Yes')


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    input()
    t = list(map(int, input().split()))
    col = collections.Counter(t)
    com = {}
    al = 0
    for key in col:
        com[key] = combinations_count(col[key], 2)
        al += com[key]
    for v in t:
        c = col[v] - 1
        if c <= 1:
            c = 0
        else:
            c = combinations_count(c, 2)
        tmp = (al - com[v]) + c
        print(tmp)


if __name__ == '__main__':
    main()

Fixed submission:

url = "https://atcoder.jp//contests/abc159/tasks/abc159_a"

def main():
    e, v = list(map(int, input().split()))
    lis = []
    for i in range(e):
        lis.append(1)
    for i in range(v):
        lis.append(2)
    count = 0
    for i in range(len(lis)):
        for j in range(i + 1, len(lis)):
            # print(lis[i], lis[j])
            if (lis[i] + lis[j]) % 2 == 0:
                count += 1
    print(count)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    L = int(input())
    l = L
    ans = 0
    m = L * 10 ** 3
    for i in range(1, m):
        for j in range(1, m):
            w = m - i - j
            t = i/ 10 ** 3 * j/ 10 ** 3 * w/ 10 ** 3
            if w < 0:
                break
            ans = ans if ans > t else t
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    L = int(input())
    l = L
    ans = 0
    a = L / 3
    print(L ** 3 /27)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k = list(map(int, input().split()))
    daice = list(map(int, input().split()))
    sum_val = 0
    kitai = []
    for i in range(0, len(daice) - k + 1):
        tmp = daice[i:i + k]
        if sum(tmp) >= sum_val:
            sum_val = sum(tmp)
            kitai = tmp
    ans = 0
    for v in kitai:
        sumt = 0
        for i in range(1, v + 1):
            sumt += i * (1 / v)
        ans += sumt
    print(ans)




if __name__ == '__main__':
    main()

Fixed submission:

url = "https://atcoder.jp//contests/abc154/tasks/abc154_d"

def search_ind(lis, k):
    tmp = sum(lis[0:k])
    m = tmp
    inds = [0, k - 1]
    for i in range(0, len(lis) - k):
        tmp = tmp - lis[i] + lis[i + k]
        # print(tmp, lis[i + k])
        if tmp > m:
            inds = [i + 1, i + k]
            m = tmp
    return inds

def main():
    n, k = list(map(int, input().split()))
    daice = list(map(int, input().split()))
    f, t = search_ind(daice, k)
    kitai = daice[f:t + 1]
    ans = 0
    for v in kitai:
        sumt = 0
        for i in range(1, v + 1):
            sumt += i * (1 / v)
        ans += sumt
    print(ans)




if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n, k = list(map(int, input().split()))
    daice = list(map(int, input().split()))
    daice_kitai = [0]

    tmp = 0
    for i in range(1, 7):
        tmp += i
        daice_kitai.append(tmp * (1 / i))
    for i in range(0, len(daice) - k + 1):
        count = 0
        tmp = 0
        for j in range(i, i + k):
            tmp += daice_kitai[daice[j]]
        count = tmp if tmp > count else count
    print(count)


if __name__ == '__main__':
    main()

Fixed submission:

url = "https://atcoder.jp//contests/abc154/tasks/abc154_d"

def search_ind(lis, k):
    tmp = sum(lis[0:k])
    m = tmp
    inds = [0, k - 1]
    for i in range(0, len(lis) - k):
        tmp = tmp - lis[i] + lis[i + k]
        # print(tmp, lis[i + k])
        if tmp > m:
            inds = [i + 1, i + k]
            m = tmp
    return inds

def main():
    n, k = list(map(int, input().split()))
    daice = list(map(int, input().split()))
    f, t = search_ind(daice, k)
    kitai = daice[f:t + 1]
    ans = 0
    for v in kitai:
        sumt = 0
        for i in range(1, v + 1):
            sumt += i * (1 / v)
        ans += sumt
    print(ans)




if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k = list(map(int, input().split()))
    monsters = list(map(int, input().split()))

    for i in range(k):
        ind = monsters.index(max(monsters))
        monsters[ind] = 0
    print(sum(monsters))

if __name__ == '__main__':
    main()

Fixed submission:
def main2():
    n, k = list(map(int, input().split()))
    monsters = list(map(int, input().split()))
    monsters.sort(reverse=True)

    for i in range(k):
        if i >= len(monsters):
            break
        monsters[i] = 0
    print(sum(monsters))

if __name__ == '__main__':
    main2()
Buggy python submission (verdict: Runtime Error):
def main():
    input()
    l = list(input().split())
    ans = []
    for i in range(len(l)):
        ans.append(l[0][i])
        ans.append(l[1][i])
    print(''.join(ans))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    input()
    l = list(input().split())
    ans = []
    for i in range(len(l[0])):
        ans.append(l[0][i])
        ans.append(l[1][i])
    print(''.join(ans))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math

def main():
    n, m = list(map(int, input().split()))
    print((n * m) // math.gcd(n, m))


if __name__ == '__main__':
    main()

Fixed submission:
import fractions


def main():
    n, m = list(map(int, input().split()))
    print((n * m) // fractions.gcd(n, m))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math

def main():
    n = int(input())
    m = math.sqrt(n)
    m = int(m) if float.is_integer(m) else math.floor(m) - 1
    div = n // m
    # print(m, div)
    print(m-1 + div-1)


if __name__ == '__main__':
    main()

Fixed submission:
import math

def main():
    n = int(input())
    m = math.sqrt(n)
    ans = []
    for i in range(1, int(m) + 1):
        div = n / i
        if not float.is_integer(div):
            continue
        ans.append((div+i)-2)

    print(int(min(ans)))


if __name__ == '__main__':
    main()