Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
q = int(input())

for i in range(q):
    t = [x for x in input().split(" ")]
    if t[0] =='1':
        s = s[::-1]
    elif t[0] == '2':
        if t[1]== '1':
            s = list(t[2]) + s
        elif t[1] == '2':
            s = s + list(t[2])

print(''.join(s))


Fixed submission:
from collections import deque

s = input()
d = deque()
header = 1
for i in s:
    d.append(i)
q = int(input())

for i in range(q):
    data = input().split()
    if len(data) == 1:
        header *= -1
    else:
        f = int(data[1])
        c = data[2]
        if header == 1:
            if f == 1:
                d.appendleft(c)
            else:
                d.append(c)
        else:
            if f == 1:
                d.append(c)
            else:
                d.appendleft(c)

if header == -1:
    d.reverse()

s = list(d)
s = "".join(s)

print(s)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
q = int(input())

for i in range(q):
    t = [x for x in input().split(" ")]
    if t[0] =='1':
        s = s[::-1]
    elif t[0] == '2':
        if t[1]== '1':
            s = list(t[2]) + s
        elif t[1] == '2':
            s = s + list(t[2])

print(''.join(s))


Fixed submission:
from collections import deque

s = input()
d = deque()
header = 1
for i in s:
    d.append(i)
q = int(input())

for i in range(q):
    data = input().split()
    if len(data) == 1:
        header *= -1
    else:
        f = int(data[1])
        c = data[2]
        if header == 1:
            if f == 1:
                d.appendleft(c)
            else:
                d.append(c)
        else:
            if f == 1:
                d.append(c)
            else:
                d.appendleft(c)

if header == -1:
    d.reverse()

s = list(d)
s = "".join(s)

print(s)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
q = int(input())

for i in range(q):
    t = [x for x in input().split(" ")]
    if t[0] =='1':
        s = s[::-1]
    elif t[0] == '2':
        if t[1]== '1':
            s = list(t[2]) + s
        elif t[1] == '2':
            s = s + list(t[2])

print(''.join(s))


Fixed submission:
from collections import deque

s = input()
d = deque()
header = 1
for i in s:
    d.append(i)
q = int(input())

for i in range(q):
    data = input().split()
    if len(data) == 1:
        header *= -1
    else:
        f = int(data[1])
        c = data[2]
        if header == 1:
            if f == 1:
                d.appendleft(c)
            else:
                d.append(c)
        else:
            if f == 1:
                d.append(c)
            else:
                d.appendleft(c)

if header == -1:
    d.reverse()

s = list(d)
s = "".join(s)

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
list = list(map(int,input().split(" ")))
result = n
for i in range(1,n):
    for j in range(i):
        if list[i] > list[j]:
            result -= 1
            break
print(result)

Fixed submission:
n = int(input())
list = list(map(int,input().split(" ")))
result = n
tem = list[0]
for i in range(n):
    if tem >= list[i]:
        tem = list[i]
    else:
        result -= 1

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
list = list(map(int,input().split(" ")))
result = n
for i in range(n):
    for j in range(i):
        if list[i] > list[j]:
            result -= 1
            break
print(result)

Fixed submission:
n = int(input())
list = list(map(int,input().split(" ")))
result = n
tem = list[0]
for i in range(n):
    if tem >= list[i]:
        tem = list[i]
    else:
        result -= 1

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
list = list(map(int,input().split(" ")))
result = n
for i in range(n):
    for j in range(i+1):
        if list[i] > list[j]:
            result -= 1
            break
print(result)

Fixed submission:
n = int(input())
list = list(map(int,input().split(" ")))
result = n
tem = list[0]
for i in range(n):
    if tem >= list[i]:
        tem = list[i]
    else:
        result -= 1

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
list = list(map(int,input().split(" ")))
result = n
for i in range(n):
    p_i = list[i]
    for j in range(i+1):
        if p_i > list[j]:
            result -= 1
            break
print(int(result))

Fixed submission:
n = int(input())
list = list(map(int,input().split(" ")))
result = n
tem = list[0]
for i in range(n):
    if tem >= list[i]:
        tem = list[i]
    else:
        result -= 1

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = list(input())
list = list(itertools.combinations(s,3))
result  = []
[x for x in list if x not in result and not result.append(x)]
print(len(result))

Fixed submission:
n=int(input())
S=input()
l=[]
for i in range(10**3):
    num=str(i).zfill(3)
    s=S
    if s.find(num[0])==-1: continue
    s=s[s.index(num[0])+1:]
    if s.find(num[1])==-1: continue
    s=s[s.index(num[1])+1:]
    if s.find(num[2])==-1: continue
    l.append(num)
print(len(set(l)))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = [int(x) for x in input().split()]

INF = 10**10
dp = [INF]*(n+k+1)
dp[0] = 0
dp[1] = abs(h[1]-h[0])
for i in range(0, n+1):
    for j in range(1, k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])



Fixed submission:
n,k = map(int ,input().split(" "))
h = [int(x) for x in input().split(" ")]
INF = 10**9
dp = [INF] * n
dp[0] = 0

for i in range(1,n):
    h_i = h[i]
    s = i-k if i-k > 0 else 0
    dp[i] = min(d_j + abs(h_i - h_j)for d_j, h_j in zip(dp[s:i], h[s:i]))

print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]
N = rri()
arr = rrm()
def solve(N, arr):
    memo = {}
    def find(status, cur_money, idx):
        if (status, cur_money, idx) in memo:
            return memo[(status, cur_money, idx)]
        if idx == N-1:
            if not status:
                return cur_money
            else:
                return cur_money+ status * arr[idx]
        ans = cur_money
        if status == 0:
            nxt_status = cur_money//arr[idx]
            nxt_money = cur_money % arr[idx]
            for i in range(idx+1, N):
                ans = max(find(nxt_status, nxt_money, i), ans)
                ans = max(ans, find(status, cur_money, i))
        else:
            nxt_status = 0
            nxt_money = cur_money+status*arr[idx]
            for i in range(idx+1, N):
                ans = max(find(nxt_status, nxt_money, i), ans)
                ans = max(ans, find(status, cur_money, i))
        memo[(status, cur_money, idx)] = ans;
        return ans
    return find(0, 1000, 0)
print(solve(N, arr))
        

Fixed submission:
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]
N = rri()
arr = rrm()
def solve(N, prices):
    ans = 1000
    for i in range(1, len(prices)):
        if prices[i]>prices[i-1]:
            ans += (prices[i]-prices[i-1])*(ans//prices[i-1])
    return ans
print(solve(N, arr))
Buggy python submission (verdict: Runtime Error):
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]

n = rri()
arr = rrm()
ans = 0
for i in range(0, n,2):
    if arr[i]&1:
        ans+=1
print(ans)

Fixed submission:
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()

    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
rrmm = lambda n: [rrm() for _ in xrange(n)]

n = rri()
arr = rrm()
ans = 0
for i in range(0, n,2):
    if arr[i]&1:
        ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

H_now = 1
for i in range(K):
    H_now *= A[i]

for j in range(K, N):
    H_next = H_now * A[j] / A[j-K]
    if H_next > H_now:
        print('Yes')
    else:
        print('No')


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

for j in range(K, N):
    if A[j] > A[j-K]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if b >= 10:
    x = a*100+b
else:
    x = a*10+b
for i in range(100):
    if x % i == 0:
        print("Yes")
        exit()
print("No")


Fixed submission:
import math

a, b =map(str, input().split())
c=a+b
c=int(c)
if math.sqrt(c)==int(math.sqrt(c)):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
p=list(map(int,input().split()))
c=0
ans=[]
if n==0:
    print(0)
else:
    for i in range(1,101):
        if x-i not in p:
            ans.append(x-i)
            c+=1
        elif x+i not in p:
            ans.append(x+i)
            c+=1
        if c!=0:
            break
print(min(ans))

Fixed submission:
x,n=map(int,input().split())
p=list(map(int,input().split()))
if n==0:
    print(x)
else:
    for i in range(0,101):
        if x-i not in p:
            print(x-i)
            break
        elif x+i not in p:
            print(x+i)
            break
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in a[1:]:
    ans*=i
print(-1 if ans>10**18 else ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)
ans=0
if a[0]==0:
    print(0)
else:
    a=a[::-1]
    ans=a[0]
    for i in a[1:]:
        ans*=i
        if ans>10**18:
            print(-1)
            break
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in a[1:]:
    ans*=i
print(-1 if ans>10**18 else ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)
ans=0
if a[0]==0:
    print(0)
else:
    a=a[::-1]
    ans=a[0]
    for i in a[1:]:
        ans*=i
        if ans>10**18:
            print(-1)
            break
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in a:
    ans*=i
print(-1 if ans>10**18 else ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)
ans=0
if a[0]==0:
    print(0)
else:
    a=a[::-1]
    ans=a[0]
    for i in a[1:]:
        ans*=i
        if ans>10**18:
            print(-1)
            break
    else:
        print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
for i in range(-10**9,10**9):
    for j in range(-10**9,10**9):
        if i**5-j**5==x:
            print(i,j)
            break

Fixed submission:
x=int(input())
ans=0
for i in range(-120,120):
    for j in range(-120,120):
        ans = i**5-j**5
        if ans == x:
            print(i,j)
            break
    else:
        continue
    break
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(n):
    for j in range(i+1,n):
        if A[i]+A[j]==abs(i-j):
            ans+=1
print(ans)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
dic={}
ans=0
for i in range(n):
    x=i-A[i]
    y=i+A[i]
    if x in dic:
        ans+=dic[x]
    if y in dic:
        dic[y]+=1
    else:
        dic[y]=1
print(ans)
Buggy python submission (verdict: Runtime Error):
k=int(input())
a,b=map(int,input().split())
for i in range(a,b):
    c=i
    if i%k==0:
        print("OK")
        break
if c%k!=0:
    print("NG")
if k==1:
    print("OK")

Fixed submission:
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
    c=i
    if i%k==0:
        print("OK")
        break
if c%k!=0:
    print("NG")
Buggy python submission (verdict: Runtime Error):
import math
a,b,n=map(int,input().split())
List=[]
for x in range(n):
    k=math.floor((a*x)/b)-a*(math.floor(x/b))
    List.append(k)
    print(List)
print(List.index(max(List)))

Fixed submission:
a,b,n=list(map(int,input().split()))
x=min(b-1,n)
ans=int(a*x/b)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
print(2*int(input()*math.pi))

Fixed submission:
import math
print(int(input())*2*math.pi)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=[input() for i in range(n)]
dic={}
for word in s:
    if word in dic:
        dic[word]+=1
    else:
        dic[word]=1
maximum=max(dic.values())
for key,value in sorted(dic.items()):
    if value==max(dic.values()):
        print(key)

Fixed submission:
N=int(input())
S=[input() for i in range(N)]
dictionary={}
for word in S:
    if word in dictionary:
        dictionary[word]+=1
    else:
        dictionary[word]=1
maximum=max(dictionary.values())
for key,value in sorted(dictionary.items()):
    if value==maximum:
        print(key)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=[input() for i in range(n)]
dic={}
for word in s:
    if word in dic:
        dic[word]+=1
    else:
        dic[word]=1
for key,value in sorted(dic.items()):
    if value==max(dic.values()):
        print(key)

Fixed submission:
N=int(input())
S=[input() for i in range(N)]
dictionary={}
for word in S:
    if word in dictionary:
        dictionary[word]+=1
    else:
        dictionary[word]=1
maximum=max(dictionary.values())
for key,value in sorted(dictionary.items()):
    if value==maximum:
        print(key)
Buggy python submission (verdict: Runtime Error):
l="abcdefghijklmnopqrstuvwxy"
print(l[l.index(input())+1])

Fixed submission:
l="abcdefghijklmnopqrstuvwxyz"
print(l[l.index(input())+1])

Buggy python submission (verdict: Runtime Error):
L=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y"]
print(L[L.index(input())+1])

Fixed submission:
l="abcdefghijklmnopqrstuvwxyz"
print(l[l.index(input())+1])
Buggy python submission (verdict: Runtime Error):
X=int(input())
while True:
    for x in range(2,X):
        if X%x==0:
            break
    else:
        print(x)
        break
    X+=1

Fixed submission:
X=int(input())
while True:
    for x in range(2,X):
        if X%x==0:
            break
    else:
        print(X)
        break
    X+=1
Buggy python submission (verdict: Runtime Error):
S=input()
count=0
for i in range(len(s)//2):
    if s[i]!=s[-(i-1)]:
        count+=1
print(count)

Fixed submission:
s=input()
count=0
for i in range(len(s)//2):
    if s[i]!=s[-i-1]:
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
L=[]
for i in range(int(n**0.5)+1):
    for j in range((n)):
        if i*j==n:
            L.append(i+j-2)
print(min(L))

Fixed submission:
n=int(input())
move=10**12
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        move=min(move,n//i+i-2)
print(move)

Buggy python submission (verdict: Runtime Error):
n=int(input())
L=[]
for i in range(n):
    for j in range((n)):
        if i*j==n:
            L.append(i+j-2)
print(min(L))

Fixed submission:
n=int(input())
move=10**12
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        move=min(move,n//i+i-2)
print(move)
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
ans=0
for i in range(q):
    l,r=map(int,input().split())
    ans=0
    for i in range(l-1,r-1):
        if s[i:i+2]=="AC":
            ans+=1
    print(ans)

Fixed submission:
n,q=map(int,input().split())
s=input()
count=[0]*n
for i in range(1,n):
    count[i]+=count[i-1]
    if s[i-1:i+1]=="AC":
        count[i]+=1
for i in range(q):
    l,r=map(int,input().split())
    print(count[r-1]-count[l-1])
Buggy python submission (verdict: Runtime Error):
l,r=map(int,input().split())
print("Left"if l>r else "Balanced"if l==r else "Right")

Fixed submission:
a,b,c,d=map(int,input().split())
print("Left"if a+b>c+d else "Balanced"if a+b==c+d else "Right")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=[]
for i in range(n):
    s=int(input())
    if s in l:
        l.pop(l.index(s))
    else:
        l.append(s)
print(len(l))

Fixed submission:
n=int(input())
s=set()
for i in range(n):
    s^={input()}
print(len(s))
Buggy python submission (verdict: Runtime Error):
g="013121212121"
x,y=map(int,input().split())
print("Yes"if g[x]==g[y] else "No")

Fixed submission:
g="0131212112121"
x,y=map(int,input().split())
print("Yes"if g[x]==g[y] else "No")
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
print([x+y+z for z in range(k+1) for y in range(k+1) for x in range(k+1)].count(s))

Fixed submission:
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    x=min(s-i,k)-max(0,s-k-i)
    if x>=0:
        ans+=x+1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
print([x+y+z for z in range(k+1) for y in range(k+1) for x in range(k+1)].count(s))

Fixed submission:
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    x=min(s-i,k)-max(0,s-k-i)
    if x>=0:
        ans+=x+1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
l=[x+y+z for z in range(k+1) for y in range(k+1) for x in range(k+1)]
print(l.count(s))

Fixed submission:
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    x=min(s-i,k)-max(0,s-k-i)
    if x>=0:
        ans+=x+1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

'''

'''

def is_not_div(n, arr, rightp, num):
    if rightp == -1:
        return True
    else:
        for i in range(0, rightp+1):
            if num % arr[i] == 0:
                return False
        return True



def solve(n, arr):
    count = 0
    for i, num in enumerate(arr):
        if i > 0 and arr[i-1] == num:
            continue
        if i < len(arr) - 1 and arr[i+1] == num:
            continue

        if is_not_div(n, arr, i-1, num):
            count += 1
    return count



n = int(input())
arr = sorted(map(int, input().split()))
print(solve(n, arr))




Fixed submission:
import sys
input = sys.stdin.readline

'''

'''

n = int(input())
a = sorted(map(int, input().split()))
largest = a[-1]
#largest = arr[-1]
div = [1] * (largest+1)
count = 0
arr = []
# remove duplicates
for i, v in enumerate(a):
    if i < (n-1) and a[i+1] == v:
        div[v] = 0
    else:
        arr.append(v)

arr.sort()

for num in arr:
    if div[num]:
        count += 1

    for d in range(num, largest+1, num):
        div[d] = 0

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

"""

"""

tot = 1
n = int(input())
arr = map(int, input().split())

for v in arr:
    tot *= v

if tot > 10**18:
    print(-1)
else:
    print(tot)


Fixed submission:
import sys
input = sys.stdin.readline

"""

"""

tot = 1
n = int(input())
arr = map(int, input().split())

for v in arr:
    if v == 0:
        tot = 0
        break
    if tot <= 10**18:
        tot *= v
    

if tot > 10**18:
    print(-1)
else:
    print(tot)
Buggy python submission (verdict: Time Limit Exceeded):
memo = {}

def gcd(a, b):
    global memo

    ia = max(a, b)
    ib = min(a, b)

    if (ia, ib) in memo:
        return memo[(ia, ib)]

    while b != 0:
        t = b
        b = a % b
        a = t
    
    memo[(ia, ib)] = a    
    return a

def tgcd(a, b, c):
    return  gcd(a, gcd(b, c))

K = int(input())
total = 0

# 3 scenarios
# X-X-X
# X-X-Y
# X-Y-Z

for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            total += tgcd(a, b, c)

        
print(total)
#total += sum(range(1, 201))
#print(total + sum(range(1,201)))
#print("diff", 10813692-total)

Fixed submission:
def gcd(a, b):
    while b != 0:
        t = b
        b = a % b
        a = t
    return a

def tgcd(a, b, c):
    return  gcd(a, gcd(b, c))

K = int(input())
total = 0

# 3 scenarios
# X-X-X
# X-X-Y
# X-Y-Z

for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            total += tgcd(a, b, c)

        
print(total)
#total += sum(range(1, 201))
#print(total + sum(range(1,201)))
#print("diff", 10813692-total)
Buggy python submission (verdict: Runtime Error):
# M submissions
# i-th problem, pi-th problem recieved Si verdict ("AC" or "WA")
# Penalty: recieve WA before AC

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

problem_ac = set()
problem_penalty = dict()

for _ in range(M):
    problem, verdict = input().split()

    if problem in problem_ac:
        continue
    elif verdict == "WA":
        problem_penalty[problem] = problem_penalty.get(problem, 0) + 1
    elif verdict == "AC":
        problem_ac.add(problem)

print(f"{len(problem_ac)} {sum(problem_penalty.values())}")

Fixed submission:
# M submissions
# i-th problem, pi-th problem recieved Si verdict ("AC" or "WA")
# Penalty: recieve WA before AC

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

problem_ac = set()
problem_penalty = dict()

for _ in range(M):
    problem, verdict = input().split()

    if problem in problem_ac:
        continue
    elif verdict == "WA":
        problem_penalty[problem] = problem_penalty.get(problem, 0) + 1
    elif verdict == "AC":
        problem_ac.add(problem)

num_ac = len(problem_ac)
num_penalties = sum(penalty for problem, penalty in problem_penalty.items() if problem in problem_ac)
print(num_ac, num_penalties)
Buggy python submission (verdict: Runtime Error):
from math import gcd

def lcm(a, b):
    return abs(a*b) / gcd(a, b)

a, b = map(int, input().strip().split(" "))

print(int(lcm(a, b)))

Fixed submission:

def gcd(a, b):
    while b != 0:
        t = b
        b = a % b
        a = t
    return a

def lcm(a, b):
    return abs(a*b) / gcd(a, b)

a, b = map(int, input().strip().split(" "))

print(int(lcm(a, b)))