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

for _ in range(q):
    tmp = input()
    if len(tmp) == 1:
        s = s[::-1]
    else:
        if tmp[2] == str(2):
            s = s + tmp[-1]
        else:
            s = tmp[-1] + s

print(s)

Fixed submission:
s = input()
q = int(input())
before = []
after = []
isReversed = 0


for _ in range(q):
    tmp = input()
    if len(tmp) == 1:
        if isReversed:
            isReversed = 0
        else:
            isReversed = 1
    else:
        if tmp[2] == str(2):
            if isReversed:
                before.append(tmp[-1])
            else:
                after.append(tmp[-1])
        else:
            if isReversed:
                after.append(tmp[-1])
            else:
                before.append(tmp[-1])


if isReversed:
    ans = "".join(after[::-1]) + s[::-1] + "".join(before)
    print(ans)

else:
    ans = "".join(before[::-1]) + s + "".join(after)
    print(ans)

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

for _ in range(q):
    tmp = input()
    if len(tmp) == 1:
        s = s[::-1]
    else:
        if tmp[2] == str(2):
            s = s + tmp[-1]
        else:
            s = tmp[-1] + s

print(s)

Fixed submission:
s = input()
q = int(input())
before = []
after = []
isReversed = 0


for _ in range(q):
    tmp = input()
    if len(tmp) == 1:
        if isReversed:
            isReversed = 0
        else:
            isReversed = 1
    else:
        if tmp[2] == str(2):
            if isReversed:
                before.append(tmp[-1])
            else:
                after.append(tmp[-1])
        else:
            if isReversed:
                after.append(tmp[-1])
            else:
                before.append(tmp[-1])


if isReversed:
    ans = "".join(after[::-1]) + s[::-1] + "".join(before)
    print(ans)

else:
    ans = "".join(before[::-1]) + s + "".join(after)
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)

cnt = 0

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        base = l[i] - l[j]
        for k in range(j + 1, n):
            if l[k] > base:
                cnt += 1
            else:
                break
print(cnt)

Fixed submission:
import bisect
n = int(input())
l = list(map(int, input().split()))
l.sort()

cnt = 0

for i in range(n - 1, 0, -1):
    for j in range(i - 1, -1, -1):
        base = l[i] - l[j]
        idx = bisect.bisect_right(l, base)
        cnt += max(j - idx, 0)
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)

cnt = 0

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        base = l[i] - l[j]
        for k in range(j + 1, n):
            if l[k] > base:
                cnt += 1
print(cnt)

Fixed submission:
import bisect
n = int(input())
l = list(map(int, input().split()))
l.sort()

cnt = 0

for i in range(n - 1, 0, -1):
    for j in range(i - 1, -1, -1):
        base = l[i] - l[j]
        idx = bisect.bisect_right(l, base)
        cnt += max(j - idx, 0)
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
# OLE?
a = input()
print(10 ** (10 ** (10 ** (10 ** (10 ** (10 ** 10))))))

Fixed submission:
a, b = map(int, input().split())
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
# OLE?
a = input()
b = input()

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

Fixed submission:
r = int(input())
print(3 * r * r)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))

for i in range(n):
    print(max(l[:i] + l[i + 1:]))


Fixed submission:
n = int(input())
l = []
for i in range(n):
    l.append([int(input()), i])
l.sort(reverse=True)
m1 = l[0][0]
m2 = l[1][0]
id1 = l[0][1]
for i in range(n):
    if i == id1:
        print(m2)
    else:
        print(m1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_ = list(map(int, input().split()))
m = min(a_)
idx = a_.index(m)
a = a_[idx:] + a_[:idx]
for i in range(a[0] + 1):
    result = [0] * (n + 1)
    result[0] = i
    for j in range(1, n + 1):
        result[j] = a[j - 1] - result[j - 1]
    if result[0] == result[n]:
        result.pop()
        rans = result[-idx:] + result[:-idx]
        ans = [n*2 for n in rans]
        print(" ".join(map(str, ans)))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
sa = sum(a)
sa2 = sum(a[::2]) * 2
a.append(a[0])
ans[0] = sa2 - sa

for i in range(1, n):
    ans[i] = a[i - 1] * 2 - ans[i - 1]

print(' '.join(map(str, ans)))
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10 ** 7)
from math import factorial as f
n, blue = map(int, input().split())
red = n - blue
mod = 10 ** 9 + 7


def p(n, r):
    return f(n) // f(n-r)


def c(n, r):
    return p(n, r) // f(r)


for i in range(1, blue + 1):
    space = c(red + 1, i)
    pattern = c(blue - 1, blue - i)
    print(space * pattern % mod)


Fixed submission:
from math import factorial as f
n, blue = map(int, input().split())
red = n - blue
mod = 10 ** 9 + 7


def p(n, r):
    return f(n) // f(n-r)


def c(n, r):
    return p(n, r) // f(r)


for i in range(1, blue + 1):
    if red < i - 1:
        print(0)
    else:
        space = c(red + 1, i)
        pattern = c(blue - 1, blue - i)
        print(space * pattern % mod)

Buggy python submission (verdict: Runtime Error):
from math import factorial as f
n, blue = map(int, input().split())
red = n - blue
mod = 10 ** 9 + 7


def p(n, r):
    return f(n) // f(n-r)


def c(n, r):
    return p(n, r) // f(r)


for i in range(1, blue + 1):
    space = c(red + 1, i)
    pattern = c(blue - 1, blue - i)
    print(space * pattern % mod)


Fixed submission:
from math import factorial as f
n, blue = map(int, input().split())
red = n - blue
mod = 10 ** 9 + 7


def p(n, r):
    return f(n) // f(n-r)


def c(n, r):
    return p(n, r) // f(r)


for i in range(1, blue + 1):
    if red < i - 1:
        print(0)
    else:
        space = c(red + 1, i)
        pattern = c(blue - 1, blue - i)
        print(space * pattern % mod)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
v = list(map(int, input().split()))
M = 0

for left in range(k + 1):
    for right in range(k - left + 1):
        if left + right > n:
            break
        hold = []
        hold.extend(v[:left])
        hold.extend(v[n-right:])
        hold.sort()
        total = sum(hold)
        for i in range(k - left - right):
            if 0 <= hold[i]:
                break
            total -= hold[i]
        M = max(M, total)

print(M)



Fixed submission:
n, k = map(int, input().split())
v = list(map(int, input().split()))
M = 0

for left in range(k + 1):
    for right in range(k - left + 1):
        if left + right > n:
            break
        hold = []
        hold.extend(v[:left])
        hold.extend(v[n-right:])
        hold.sort()
        total = sum(hold)
        for i in range(min(k - left - right, left + right)):
            if 0 <= hold[i]:
                break
            total -= hold[i]
        M = max(M, total)

print(M)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
v = list(map(int, input().split()))
M = 0

for left in range(k + 1):
    for right in range(k - left + 1):
        if left + right > n:
            break
        hold = []
        hold.extend(v[:left])
        hold.extend(v[n-right:])
        hold.sort()
        total = sum(hold)
        for i in range(min(k - left - right)):
            if 0 <= hold[i]:
                break
            total -= hold[i]
        M = max(M, total)

print(M)



Fixed submission:
n, k = map(int, input().split())
v = list(map(int, input().split()))
M = 0

for left in range(k + 1):
    for right in range(k - left + 1):
        if left + right > n:
            break
        hold = []
        hold.extend(v[:left])
        hold.extend(v[n-right:])
        hold.sort()
        total = sum(hold)
        for i in range(min(k - left - right, left + right)):
            if 0 <= hold[i]:
                break
            total -= hold[i]
        M = max(M, total)

print(M)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
k = min(n, k)
v = list(map(int, input().split()))
M = 0

for left in range(k + 1):
    for right in range(k - left + 1):
        hold = []
        hold.extend(v[:left])
        hold.extend(v[n-right:])
        hold.sort()
        total = sum(hold)
        for i in range(k - left - right):
            if i > len(hold):
                break
            if 0 <= hold[i]:
                break
            if hold[i] < 0:
                total -= hold[i]

        M = max(M, total)

print(M)



Fixed submission:
n, k = map(int, input().split())
v = list(map(int, input().split()))
M = 0

for left in range(k + 1):
    for right in range(k - left + 1):
        if left + right > n:
            break
        hold = []
        hold.extend(v[:left])
        hold.extend(v[n-right:])
        hold.sort()
        total = sum(hold)
        for i in range(min(k - left - right, left + right)):
            if 0 <= hold[i]:
                break
            total -= hold[i]
        M = max(M, total)

print(M)
Buggy python submission (verdict: Runtime Error):
input("ATCG"["TAGC".find(input())])


Fixed submission:
B = input()

_dir = {"A": "T", "T": "A", "G": "C", "C": "G"}

print(_dir[B])
Buggy python submission (verdict: Time Limit Exceeded):
from operator import itemgetter

n, m = map(int, input().split())
money = 0
li = sorted([list(map(int, input().split())) for _ in range(n)])

for j in range(n):
    shop = li.pop(0)
    if m < shop[1]:
        money += m * shop[0]
        break
    money += shop[0] * shop[1]
    m -= shop[1]

print(money)



Fixed submission:
n, m = map(int, input().split())
money = 0
li = []

for i in range(n):
    li.append(list(map(int, input().split())))
li.sort()

for j in range(n):
    shop = li.pop(0)
    if m < shop[1]:
        money += m * shop[0]
        break
    money += shop[0] * shop[1]
    m -= shop[1]

print(money)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
money = 0
li = []

for i in range(n):
    li.append(list(map(int, input().split())))
li.sort()

while 0 < m:
    shop = li.pop(0)
    if m < shop[1]:
        money += m * shop[0]
        break
    money += shop[0] * shop[1]
    m -= shop[1]

print(money)


Fixed submission:
n, m = map(int, input().split())
money = 0
li = []

for i in range(n):
    li.append(list(map(int, input().split())))
li.sort()

for j in range(n):
    shop = li.pop(0)
    if m < shop[1]:
        money += m * shop[0]
        break
    money += shop[0] * shop[1]
    m -= shop[1]

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

for i in range(a, b):
    temp = temp ^ (i + 1)

print(temp)


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


def mod(n):
    return n % 4


def xor(num):
    if mod(num-1) == 0:
        return 0
    elif mod(num-1) == 1:
        return num
    elif mod(num-1) == 2:
        return 1
    elif mod(num-1) == 3:
        return num + 1


print(xor(a-1) ^ xor(b))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
diff = []
if M <= N:
    print(0)

for i in range(1, m):
    diff.append(x[i] - x[i - 1])
diff.sort()
print(sum(diff[:m-n]))


Fixed submission:
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
diff = []
if m <= n:
    print(0)
    exit()
for i in range(1, m):
    diff.append(x[i] - x[i - 1])
diff.sort()
print(sum(diff[:m-n]))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
c = [float("INF")] * n
c[0] = 0
for i in range(1, n):
    for j in range(1, min(n, k + 1)):
        c[i] = min(c[i], c[i - j] + abs(h[i] - h[i - j]))

print(c[n - 1])



Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
c = [float("INF")] * n
c[0] = 0
for i in range(1, n):
    for j in range(1, min(n, k + 1)):
        c[i] = min(c[i], c[i - j] + abs(h[i] - h[i - j]))

print(c[n - 1])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
c = [float("INF")] * n
c[0] = 0
for i in range(1, min(n, k + 1)):
    c[i] = abs(h[i] - h[0])

for i in range(2, n):
    for j in range(1, k + 1):
        c[i] = min(c[i], c[i - j] + abs(h[i] - h[i - j]))

print(c[n - 1])


Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
c = [float("INF")] * n
c[0] = 0
for i in range(1, n):
    for j in range(1, min(n, k + 1)):
        c[i] = min(c[i], c[i - j] + abs(h[i] - h[i - j]))

print(c[n - 1])

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

for i in range(2, n):
    c[i] = c[i - 1] + abs(h[i] - h[i - 1])
    for j in range(1, k + 1):
        if i - j < 0:
            continue
        c[i] = min(c[i], c[i - j] + abs(h[i] - h[i - j]))

print(c[n - 1])


Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
c = [float("INF")] * n
c[0] = 0
for i in range(1, n):
    for j in range(1, min(n, k + 1)):
        c[i] = min(c[i], c[i - j] + abs(h[i] - h[i - j]))

print(c[n - 1])
Buggy python submission (verdict: Time Limit Exceeded):
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[0] * (w + 1) for _ in range(n)]
for i in range(n):
    for j in range(w + 1):
        if 0 <= j - goods[i][0]:
            dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - goods[i][0]] + goods[i][1])
        dp[i][j] = max(dp[i][j], dp[i - 1][j])
print(dp[n - 1][w])


Fixed submission:
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[0] * (w + 1) for _ in range(n)]
for i in range(n):
    for j in range(w + 1):
        if 0 <= j - goods[i][0]:
            dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - goods[i][0]] + goods[i][1])
        dp[i][j] = max(dp[i][j], dp[i - 1][j])
print(dp[n - 1][w])
Buggy python submission (verdict: Runtime Error):
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[0] * (w + 1) for _ in range(n)]
for i in range(n):
    for j in range(w + 1):
        if 0 <= j - goods[i][0]:
            dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - goods[i][0]] + goods[i][1])
        dp[i][j] = max(dp[i][j], dp[i - 1][j])
print(dp[n - 1][w])


Fixed submission:
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[float("INF")] * (10 ** 5 + 1) for _ in range(n + 1)]
dp[0][0] = 0

for i in range(n):
    for j in range(10 ** 5 + 1):
        if 0 <= j - goods[i][1]:
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - goods[i][1]] + goods[i][0])
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])


M = 0
for i in range(10 ** 5 + 1):
    if dp[n][i] <= w:
        M = i
print(M)

Buggy python submission (verdict: Runtime Error):
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[0] * (w + 1) for _ in range(n + 1)]
for i in range(n):
    for j in range(w + 1):
        if 0 <= j - goods[i][0]:
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - goods[i][0]] + goods[i][1])
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
print(dp[n][w])


Fixed submission:
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[float("INF")] * (10 ** 5 + 1) for _ in range(n + 1)]
dp[0][0] = 0

for i in range(n):
    for j in range(10 ** 5 + 1):
        if 0 <= j - goods[i][1]:
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - goods[i][1]] + goods[i][0])
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])


M = 0
for i in range(10 ** 5 + 1):
    if dp[n][i] <= w:
        M = i
print(M)

Buggy python submission (verdict: Runtime Error):
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[0] * (w + 1) for _ in range(n + 1)]
for i in range(n):
    for j in range(w + 1):
        if 0 <= j - goods[i][0]:
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - goods[i][0]] + goods[i][1])
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])

for i in range(n + 1):
    print(dp[i])
print(dp[n][w])


Fixed submission:
n, w = map(int, input().split())
goods = [list(map(int, input().split())) for _ in range(n)]
dp = [[float("INF")] * (10 ** 5 + 1) for _ in range(n + 1)]
dp[0][0] = 0

for i in range(n):
    for j in range(10 ** 5 + 1):
        if 0 <= j - goods[i][1]:
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - goods[i][1]] + goods[i][0])
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])


M = 0
for i in range(10 ** 5 + 1):
    if dp[n][i] <= w:
        M = i
print(M)
Buggy python submission (verdict: Runtime Error):
print("Christmas"+" Eve"*(25-int(input()))

Fixed submission:
d = int(input())
if d == 25:
    print("Christmas")
elif d == 24:
    print("Christmas Eve")
elif d == 23:
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
city = [[0] for _ in range(n)]
buffer = []

for i in range(m):
    p, y = map(int, input().split())
    buffer.append(list([p, y]))
    city[p - 1].append(y)

for i in range(n):
    city[i].sort()

for i in range(m):
    p, y = buffer[i]
    print(str(p).zfill(6) + str(city[p - 1].index(y)).zfill(6))


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

n, m = map(int, input().split())
l = []
num = [0] * n
ans = [""] * m

for i in range(m):
    p, y = map(int, input().split())
    l.append(list([p, y, i]))

l.sort()


for p, y, i in l:
    num[p - 1] += 1
    ans[i] = str(p).zfill(6) + str(num[p - 1]).zfill(6)

for a in ans:
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
city = [[0] for _ in range(n)]
buffer = []

for i in range(m):
    p, y = map(int, input().split())
    buffer.append(list([p, y]))
    city[p - 1].append(y)

for i in range(n):
    city[i].sort()

for i in range(m):
    p, y = buffer[i]
    print(str(p).zfill(6) + str(city[p - 1].index(y)).zfill(6))


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

n, m = map(int, input().split())
l = []
num = [0] * n
ans = [""] * m

for i in range(m):
    p, y = map(int, input().split())
    l.append(list([p, y, i]))

l.sort()


for p, y, i in l:
    num[p - 1] += 1
    ans[i] = str(p).zfill(6) + str(num[p - 1]).zfill(6)

for a in ans:
    print(a)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline()

n, m = map(int, input().split())
city = [[0] for _ in range(n)]
buffer = []

for i in range(m):
    p, y = map(int, input().split())
    buffer.append(list([p, y]))
    city[p - 1].append(y)

for i in range(n):
    city[i].sort()

for i in range(m):
    p, y = buffer[i]
    print(str(p).zfill(6) + str(city[p - 1].index(y)).zfill(6))


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

n, m = map(int, input().split())
l = []
num = [0] * n
ans = [""] * m

for i in range(m):
    p, y = map(int, input().split())
    l.append(list([p, y, i]))

l.sort()


for p, y, i in l:
    num[p - 1] += 1
    ans[i] = str(p).zfill(6) + str(num[p - 1]).zfill(6)

for a in ans:
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
city = [[0] for _ in range(n)]
cnt = [0] * n
buffer = []

for i in range(m):
    p, y = map(int, input().split())
    buffer.append(list([p, y]))
    city[p - 1].append(y)

for i in range(n):
    city[i].sort()

for i in range(m):
    p, y = buffer[i]
    cnt[p - 1] += 1
    print(str(p).zfill(6) + str(city[p - 1].index(y)).zfill(6))


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

n, m = map(int, input().split())
l = []
num = [0] * n
ans = [""] * m

for i in range(m):
    p, y = map(int, input().split())
    l.append(list([p, y, i]))

l.sort()


for p, y, i in l:
    num[p - 1] += 1
    ans[i] = str(p).zfill(6) + str(num[p - 1]).zfill(6)

for a in ans:
    print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())


def divisor(num):
    opside = num
    i = 2
    div = [1, opside]
    while i <= opside:
        if num % i == 0:
            opside = num // i
            if i == opside:
                div.append(i)
            elif opside <= i:
                break
            else:
                div.append(i)
                div.append(opside)
        i += 1
    div.sort()
    return div


ans = 0
for i in divisor(m):
    if n <= m // i:
        ans = i
    else:
        break
print(ans)

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


def divisor(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    divisors.sort()
    return divisors


ans = 0
for i in divisor(m):
    if n <= m // i:
        ans = i
    else:
        break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())


def divisor(num):
    opside = num
    i = 2
    div = [1, opside]
    while i <= opside:
        if num % i == 0:
            opside = num // i
            if i == opside:
                div.append(i)
            elif opside <= i:
                break
            else:
                div.append(i)
                div.append(opside)
        i += 1
    div.sort()
    return div


ans = 0
for i in divisor(m):
    if n <= m // i:
        ans = i
print(ans)

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


def divisor(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    divisors.sort()
    return divisors


ans = 0
for i in divisor(m):
    if n <= m // i:
        ans = i
    else:
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

import collections

n = int(input())
v_l = list(map(int, input().split()))

if len(set(v_l)) == 1:
    print(n // 2)
    exit()

v_l_odd = []
v_l_even = []

for i in range(n):
    if i % 2 == 0:
        v_l_odd.append(v_l[i])
    else:
        v_l_even.append(v_l[i])

max_odd = collections.Counter(v_l_odd)
mon = max_odd.most_common(1)[0][0]
max_even = collections.Counter(v_l_even)
men = max_even.most_common(1)[0][0]

if mon == men:
    if max(max_odd.most_common(2)[1][1], max_even.most_common(2)[1][1]) == max_odd.most_common(2)[1][1]:
        mon = max_odd.most_common(2)[1][1]
    else:
        men = max_even.most_common(2)[1][1]

v_l_odd_l = []
v_l_even_l = []

for i in range(n):
    if i % 2 == 0:
        if v_l[i] != mon:
            v_l_odd_l.append(v_l[i])
    else:
        if v_l[i] != men:
            v_l_even_l.append(v_l[i])

print(len(v_l_odd_l) + len(v_l_even_l))




Fixed submission:
n = input()
print(n.translate(str.maketrans({'1': '9', '9': '1'})))
Buggy python submission (verdict: Runtime Error):
s, t = [input() for _ in range(2)]

for i in range(len(s)):
    if s[i] == t[i]:
        pass
    else:
        s_diff = s[i]
        t_diff = t[i]
        s = s.translate(str.maketrans({s_diff: "", t_diff: ""}))
        t = t.translate(str.maketrans({s_diff: "", t_diff: ""}))
if s == t:
    print("Yes")
else:
    print("No")


Fixed submission:
num = list(map(int, input().split()))
num.sort()
num.reverse()
m_ = int(str(num[0]) + str(num[1]))
_m = num[2]
sum_ = m_ + _m
print(sum_)