Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(m):
        ma = max(a)
        a[a.index(ma)] //= 2
    print(sum(a))


if __name__ == "__main__":
    resolve()


Fixed submission:
import heapq


def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    query = []
    for i in range(n):
        heapq.heappush(query, -a[i])
    for i in range(m):
        nexta = -1 * heapq.heappop(query) // 2
        heapq.heappush(query, -nexta)
    print(-sum(query))


if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(m):
        m = max(a)
        a[a.index(m)] //= 2
    print(sum(a))


if __name__ == "__main__":
    resolve()


Fixed submission:
import heapq


def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    query = []
    for i in range(n):
        heapq.heappush(query, -a[i])
    for i in range(m):
        nexta = -1 * heapq.heappop(query) // 2
        heapq.heappush(query, -nexta)
    print(-sum(query))


if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()
    for i in range(m):
        m = a[-1]
        disc = m // 2
        a.pop()
        a.append(disc)
        a.sort()
    print(sum(a))


if __name__ == "__main__":
    resolve()


Fixed submission:
import heapq


def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    query = []
    for i in range(n):
        heapq.heappush(query, -a[i])
    for i in range(m):
        nexta = -1 * heapq.heappop(query) // 2
        heapq.heappush(query, -nexta)
    print(-sum(query))


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
kids = [0] * len(s)
for i, c in enumerate(s):
    now = i
    if c == "R":
        while s[now + 1] == "R":
            now += 1
        diff = abs(now - i)
        if diff % 2:
            kids[now + 1] += 1
        else:
            kids[now] += 1
    else:
        while s[now - 1] == "L":
            now -= 1
        diff = abs(now - i)
        if diff % 2:
            kids[now - 1] += 1
        else:
            kids[now] += 1
print(" ".join([str(k) for k in kids]))


Fixed submission:
s = list(input())
kids = [0] * len(s)

for d in ["R", "L"]:
    c = 0
    for i in range(len(s)):
        if s[i] == d:
            c += 1
        else:
            kids[i] += c // 2
            kids[i - 1] += (c + 1) // 2
            c = 0
    s.reverse()
    kids.reverse()

print(" ".join([str(k) for k in kids]))
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    n = int(input())
    a = list(int(input()) for _ in range(n))
    for idx in range(n):
        d = max([v for i, v in enumerate(a) if i != idx])
        print(d)


if __name__ == "__main__":
    solve()


Fixed submission:
def solve():
    n = int(input())
    a = list(int(input()) for _ in range(n))
    ranking = sorted(a)[::-1]
    first = ranking[0]
    second = ranking[1]
    first_idx = a.index(first)
    for idx in range(n):
        if idx == first_idx:
            print(second)
        else:
            print(first)


if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Runtime Error):
from itertools import combinations
import math


def solve():
    l, r = map(int, input().split())
    a = 2018
    for i, j in combinations(range(l, r + 1), 2):
        amari = (i * j) % 2019
        if amari == 0:
            return 0
        elif amari < a:
            a = amari
    return a


if __name__ == "__main__":
    print(solve())


Fixed submission:
from itertools import combinations
import math


def solve():
    l, r = map(int, input().split())
    a = 2018
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            amari = (i * j) % 2019
            if amari == 0:
                return 0
            elif amari < a:
                a = amari
    return a


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
import math


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    num_b = b - b // c - b // d + b // lcm
    num_a = a - 1 - (a - 1) // c - (a - 1) // d + (a - 1) // lcm
    return num_b - num_a


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    s = input()
    return "Bad" if any([s[i] == s[i + 1] for i in range(len(s) - 1)]) else "Good"


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
import math


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    div_c = b // c - (a - 1) // c
    div_d = b // d - (a - 1) // d
    div_cd = b // lcm - (a - 1) // lcm
    return (b - a + 1) - div_c - div_d + div_cd


if __name__ == "__main__":
    print(solve())


Fixed submission:
import fractions


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // fractions.gcd(c, d)
    div_c = b // c - (a - 1) // c
    div_d = b // d - (a - 1) // d
    div_cd = b // lcm - (a - 1) // lcm
    return (b - a + 1) - div_c - div_d + div_cd


if __name__ == "__main__":
    print(solve())

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


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    num_b = b - b // c - b // d + b // lcm
    a -= 1
    num_a = a - a // c - a // d + a // lcm
    return num_b - num_a


if __name__ == "__main__":
    print(solve())


Fixed submission:
import fractions


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // fractions.gcd(c, d)
    div_c = b // c - (a - 1) // c
    div_d = b // d - (a - 1) // d
    div_cd = b // lcm - (a - 1) // lcm
    return (b - a + 1) - div_c - div_d + div_cd


if __name__ == "__main__":
    print(solve())

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


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    num_b = b - b // c - b // d + b // lcm
    num_a = a - 1 - (a - 1) // c - (a - 1) // d + (a - 1) // lcm
    return num_b - num_a


if __name__ == "__main__":
    print(solve())


Fixed submission:
import fractions


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // fractions.gcd(c, d)
    div_c = b // c - (a - 1) // c
    div_d = b // d - (a - 1) // d
    div_cd = b // lcm - (a - 1) // lcm
    return (b - a + 1) - div_c - div_d + div_cd


if __name__ == "__main__":
    print(solve())

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


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    b_c = b // c
    b_d = b // d
    b_cd = b // lcm
    a_c = (a - 1) // c
    a_d = (a - 1) // d
    a_cd = (a - 1) // lcm
    return b - b_c - b_d + b_cd - (a - 1 - a_c - a_d + a_cd)


if __name__ == "__main__":
    print(solve())


Fixed submission:
import fractions


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // fractions.gcd(c, d)
    div_c = b // c - (a - 1) // c
    div_d = b // d - (a - 1) // d
    div_cd = b // lcm - (a - 1) // lcm
    return (b - a + 1) - div_c - div_d + div_cd


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    a, b= map(int, input().split())
    if a > 12:
        return b
    elif 6 <= a <= 12:
        return b // 2
    else
        return 0
        


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    a, b = map(int, input().split())
    if a > 12:
        return b
    elif 6 <= a <= 12:
        return b // 2
    else:
        return 0


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    bc = list(list(map(int, input().split())) for _ in range(m))
    for b, c in bc:
        a += [c for _ in range(b)]
    print(sum(sorted(a, reverse=True)[:n]))


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    n, m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    bc = list(list(map(int, input().split())) for _ in range(m))
    pairs = [(ai, 1) for ai in a]
    for b, c in bc:
        pairs.append((c, b))
    pairs.sort(key=lambda x: x[0], reverse=True)
    c = 0
    ans = 0
    for v, num in pairs:
        if c + num <= n:
            ans += v * num
            c += num
        else:
            ans += v * (n - c)
            break
    print(ans)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n = int(input())
    s = input()
    if len(set(s)) == 1:
        print(0)
    else:
        ans = min(s.count("."), s.count("#"))
        for i in range(n):
            if s[i:i + 2] == ".#":
                t = s[:i + 1].count("#") + s[i + 1:].count(".")
                if t < ans:
                    ans = t
        print(ans)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    n = int(input())
    s = input()
    if len(set(s)) == 1:
        print(0)
    else:
        acc_w, acc_b = [], []
        w, b = 0, 0
        for i in range(n):
            if s[i] == ".":
                w += 1
            else:
                b += 1
            acc_w.append(w)
            acc_b.append(b)
        w = s.count(".")
        b = s.count("#")
        ans = min(w, b)
        for i in range(n - 1):
            if s[i] == "." and s[i + 1] == "#":
                t = acc_b[i] + w - acc_w[i]
                if t < ans:
                    ans = t
        print(ans)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
import math


def solve():
    abcde = [int(input()) for _ in range(5)]
    last = min([i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])))
    hoge = sum([math.ceil(i / 10) * 10 for i in abcde]) - (math.ceil(last / 10) * 10)
    print(hoge + last)


if __name__ == "__main__":
    solve()


Fixed submission:
import math


def solve():
    abcde = [int(input()) for _ in range(5)]
    if any([str(i)[-1] != "0" for i in abcde]):
        last = min([i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])))
    else:
        last = min(abcde)
    hoge = sum([math.ceil(i / 10) * 10 for i in abcde]) - (math.ceil(last / 10) * 10)
    print(hoge + last)


if __name__ == "__main__":
    solve()

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


def solve():
    abcde = [int(input()) for _ in range(5)]
    last = min([i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])))
    hoge = sum([math.ceil(int(i) / 10) * 10 for i in abcde if not i == last])
    print(hoge + last)


if __name__ == "__main__":
    solve()


Fixed submission:
import math


def solve():
    abcde = [int(input()) for _ in range(5)]
    if any([str(i)[-1] != "0" for i in abcde]):
        last = min([i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])))
    else:
        last = min(abcde)
    hoge = sum([math.ceil(i / 10) * 10 for i in abcde]) - (math.ceil(last / 10) * 10)
    print(hoge + last)


if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    n, q = map(int, input().split())
    s = input()
    lrs = list(list(map(int, input().split())) for _ in range(q))
    ans = [s[l - 1:r].count("AC") for l, r in lrs]
    print(*ans, sep="\n")


if __name__ == "__main__":
    solve()


Fixed submission:
def solve():
    n, q = map(int, input().split())
    s = input()
    lrs = list(list(map(int, input().split())) for _ in range(q))
    # ans = [s[l - 1:r].count("AC") for l, r in lrs]
    c = [0] * n
    for i in range(1, n):
        c[i] = c[i - 1]
        if s[i - 1] == "A" and s[i] == "C":
            c[i] += 1
    ans = [c[r - 1] - c[l - 1] for l, r in lrs]
    print(*ans, sep="\n")


if __name__ == "__main__":
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    n, q = map(int, input().split())
    s = input()
    lrs = list(list(map(int, input().split())) for _ in range(q))
    ans = [s[l - 1:r].count("AC") for l, r in lrs]
    print(*ans, sep="\n")


if __name__ == "__main__":
    solve()


Fixed submission:
def solve():
    n, q = map(int, input().split())
    s = input()
    lrs = list(list(map(int, input().split())) for _ in range(q))
    # ans = [s[l - 1:r].count("AC") for l, r in lrs]
    c = [0] * n
    for i in range(1, n):
        c[i] = c[i - 1]
        if s[i - 1] == "A" and s[i] == "C":
            c[i] += 1
    ans = [c[r - 1] - c[l - 1] for l, r in lrs]
    print(*ans, sep="\n")


if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Runtime Error):
import functools
import math


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    return functools.reduce(math.gcd, a)


if __name__ == "__main__":
    print(solve())


Fixed submission:
from functools import reduce
import math
import fractions


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    return reduce(fractions.gcd, a)


if __name__ == "__main__":
    print(solve())

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


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    return functools.reduce(math.gcd, a)


if __name__ == "__main__":
    print(solve())


Fixed submission:
from functools import reduce
import math
import fractions


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    return reduce(fractions.gcd, a)


if __name__ == "__main__":
    print(solve())

Buggy python submission (verdict: Runtime Error):
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    while sum([True for i in a if i > 1]) > 1:
        min_mon = min(a)
        idx = a.index(min_mon)
        a = [mon if i == idx else mon % min_mon for i, mon in enumerate(a)]
    print(sum(a))


if __name__ == "__main__":
    solve()


Fixed submission:
from functools import reduce
import math
import fractions


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    return reduce(fractions.gcd, a)


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    n, m = map(int, input().split())
    x = list(map(int, input().split()))
    x.sort()
    diff = [x[i + 1] - x[i] for i in range(m)]
    diff.sort(reverse=True)
    return sum(diff[n - 1:])


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    n, m = map(int, input().split())
    x = sorted(list(map(int, input().split())))
    diff = sorted([x[i + 1] - x[i] for i in range(m - 1)], reverse=True)
    return sum(diff[n - 1:])


if __name__ == "__main__":
    print(solve())

Buggy python submission (verdict: Runtime Error):
def solve():
    n, m = map(int, input().split())
    x = sorted(list(map(int, input().split())))
    diff = sorted([x[i + 1] - x[i] for i in range(m)], reverse=True)
    return sum(diff[n - 1:])


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    n, m = map(int, input().split())
    x = sorted(list(map(int, input().split())))
    diff = sorted([x[i + 1] - x[i] for i in range(m - 1)], reverse=True)
    return sum(diff[n - 1:])


if __name__ == "__main__":
    print(solve())

Buggy python submission (verdict: Runtime Error):
def solve():
    n, m = map(int, input().split())
    if n >= m:
        return 0
    x = sorted(list(map(int, input().split())))
    diff = sorted([x[i + 1] - x[i] for i in range(m)], reverse=True)
    return sum(diff[n - 1:])


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    n, m = map(int, input().split())
    x = sorted(list(map(int, input().split())))
    diff = sorted([x[i + 1] - x[i] for i in range(m - 1)], reverse=True)
    return sum(diff[n - 1:])


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [10 ** 9] * n
    dp[0] = 0
    dp[1] = abs(h[1] - h[0])
    for i in range(2, n):
        for j in range(1, min(k + 1, i + 1)):
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))
    print(dp[-1])


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [10 ** 9] * n
    dp[0] = 0
    dp[1] = abs(h[1] - h[0])
    for i in range(2, n):
        for j in range(1, min(k + 1, i + 1)):
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))
    print(dp[-1])


if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [0] * n
    dp[0] = 0
    dp[1] = abs(h[1] - h[0])
    for i in range(2, n):
        dp[i] = min([dp[i - j] + abs(h[i - j] - h[i]) for j in range(1, min(k + 1, i + 1))])
    print(dp[-1])


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [10 ** 9] * n
    dp[0] = 0
    dp[1] = abs(h[1] - h[0])
    for i in range(2, n):
        for j in range(1, min(k + 1, i + 1)):
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))
    print(dp[-1])


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    s = input()
    ans = 0
    for i in range(len(s)):
        if s[i] == "W":
            ans += s[:i].count("B")
    print(ans)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    s = input()
    ans = 0
    b = 0
    for i in range(len(s)):
        if s[i] == "W":
            ans += b
        else:
            b += 1
    print(ans)


if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    s = input()
    ans = 0
    while "BW" in s:
        ans += s.count("BW")
        s = s.replace("BW", "WB")
    print(ans)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    s = input()
    ans = 0
    b = 0
    for i in range(len(s)):
        if s[i] == "W":
            ans += b
        else:
            b += 1
    print(ans)


if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    s = list(input())
    ls = len(s)
    ans = 0
    while "BW" in "".join(s):
        for i in range(ls - 1):
            if s[i] == "B" and s[i + 1] == "W":
                s[i], s[i + 1] = "W", "B"
                ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()


Fixed submission:
def resolve():
    s = input()
    ans = 0
    b = 0
    for i in range(len(s)):
        if s[i] == "W":
            ans += b
        else:
            b += 1
    print(ans)


if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
def solve():
    d = int(input())
    eves = 25 - d
    return "Christmas" + " Eve" + eves


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    d = int(input())
    eves = 25 - d
    return "Christmas" + " Eve" * eves


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    n, k = map(int, input().split())
    h = sorted(list(int(input()) for _ in range(n)))
    min_diff = 10 ** 9
    for i in range(n - k + 1):
        part = h[i:i + k]
        diff = part[-1] - part[0]
        if diff < min_diff:
            min_diff = diff
    return min_diff


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    n, k = map(int, input().split())
    h = sorted(list(int(input()) for _ in range(n)))
    return min(h[i + k - 1] - h[i] for i in range(n - k + 1))


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    x, y = map(int, input())
    return x + y // 2


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    x, y = map(int, input().split())
    return x + y // 2


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    age = int(input())
    if age == 1:
        return "Hello World"
    a, b = map(int, input().split())
    return a + b


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    age = int(input())
    if age == 1:
        return "Hello World"
    a, b = list(int(input()) for _ in range(2))
    return a + b


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
from functools import reduce
import math


def solve():
    n, X = map(int, input().split())
    xs = list(map(int, input().split()))
    diffs = [abs(x - X) for x in xs]
    return reduce(math.gcd, diffs)


if __name__ == "__main__":
    print(solve())


Fixed submission:
from functools import reduce
import fractions


def solve():
    n, X = map(int, input().split())
    xs = list(map(int, input().split()))
    diffs = [abs(x - X) for x in xs]
    return reduce(fractions.gcd, diffs)


if __name__ == "__main__":
    print(solve())

Buggy python submission (verdict: Runtime Error):
from functools import reduce
import math


def solve():
    n, X = map(int, input().split())
    xs = list(map(int, input().split()))
    diffs = [abs(x - X) for x in xs]
    return reduce(math.gcd, diffs)


if __name__ == "__main__":
    print(solve())


Fixed submission:
from functools import reduce
import fractions


def solve():
    n, X = map(int, input().split())
    xs = list(map(int, input().split()))
    diffs = [abs(x - X) for x in xs]
    return reduce(fractions.gcd, diffs)


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
def solve():
    s = input()
    return [c for c in s if c != "1"][0]


if __name__ == "__main__":
    print(solve())


Fixed submission:
def solve():
    s = input()
    k = int(input())
    head_ones = 0
    for c in s:
        if c != "1":
            break
        else:
            head_ones += 1

    return "1" if head_ones >= k else [c for c in s if c != "1"][0]


if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    lcm_a = lcm(*a)
    fm = sum([(lcm_a - 1) % ai for ai in a])
    return fm


def lcm_base(x, y):
    return x * y // math.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    print(solve())


Fixed submission:
import fractions
from functools import reduce


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    lcm_a = lcm(*a)
    fm = sum([(lcm_a - 1) % ai for ai in a])
    return fm


def lcm_base(x, y):
    return x * y // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    print(solve())