Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
T1 = [[] for i in range(n)]
T2 = [[] for i in range(m)]
for i in range(n):
    a = list(input())
    T1[i] = a
for i in range(m):
    a = list(input())
    T2[i] = a

flag = False
for i in range(n - m + 1):
    for j in range(n - m + 1):
        if T1[i][j: j + m] == T2[0]:
            k = i
            l = 0
            while k < n - m + 1:
                if T1[k][j:j + m] != T2[l]:
                    break
                k += 1
                l += 1
                if l == m:
                    flag = True


if flag:
    print("Yes")
else:
    print("No")

Fixed submission:
n, m = map(int, input().split())
T1 = [[] for i in range(n)]
T2 = [[] for i in range(m)]
for i in range(n):
    a = list(input())
    T1[i] = a
for i in range(m):
    a = list(input())
    T2[i] = a

flag = False
for i in range(n - m + 1):
    for j in range(n - m + 1):
        l = 0
        if T1[i][j: j + m] == T2[l]:
            k = i
            while k < n - m + 1 and l < m:
                if T1[k][j:j + m] != T2[l]:
                    break
                k += 1
                l += 1
                if l == m:
                    flag = True


if flag:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
T1 = [[] for i in range(n)]
T2 = [[] for i in range(m)]
for i in range(n):
    a = list(input())
    T1[i] = a
for i in range(m):
    a = list(input())
    T2[i] = a

flag = False
for i in range(n - m):
    for j in range(n - m):
        if T1[i][j: j + m] == T2[0]:
            k = i
            l = 0
            while k < n - m + 1:
                if T1[k][j:j + m] != T2[l]:
                    break
                k += 1
                l += 1
                if k == i + m:
                    flag = True


if flag:
    print("Yes")
else:
    print("No")

Fixed submission:
n, m = map(int, input().split())
T1 = [[] for i in range(n)]
T2 = [[] for i in range(m)]
for i in range(n):
    a = list(input())
    T1[i] = a
for i in range(m):
    a = list(input())
    T2[i] = a

flag = False
for i in range(n - m + 1):
    for j in range(n - m + 1):
        l = 0
        if T1[i][j: j + m] == T2[l]:
            k = i
            while k < n - m + 1 and l < m:
                if T1[k][j:j + m] != T2[l]:
                    break
                k += 1
                l += 1
                if l == m:
                    flag = True


if flag:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
class BIT:
    def __init__(self, n):
        self.n = n
        self.bit = [0] * (n + 1)

    def add(self, k, x):
        while k <= self.n:
            self.bit[k] += x
            k += k & -k

    def sum(self, k):
        s = 0
        while k > 0:
            s += self.bit[k]
            k -= k & -k
        return s


n, m = map(int, input().split())
st = BIT(m)
L, R = [], []
d = [[] for i in range(m + 1)]
for i in range(n):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
    d[r - l + 1].append(i)

num = n
for i in range(1, m + 1):
    num -= len(d[i])
    for j in d[i]:
        st.add(L[j], 1)
        st.add(R[j] + 1, -1)

    tmp = 0
    k = i
    for j in range(k, m + 1, i):
        tmp += st.sum(j)

    print(num + tmp)


Fixed submission:
class BIT:
    def __init__(self, n):
        self.n = n
        self.bit = [0] * (n + 1)

    def add(self, k, x):
        while k <= self.n:
            self.bit[k] += x
            k += k & -k

    def sum(self, k):
        s = 0
        while k > 0:
            s += self.bit[k]
            k -= k & -k
        return s


n, m = map(int, input().split())
st = BIT(m)
L, R = [], []
d = [[] for i in range(m + 1)]
for i in range(n):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
    d[r - l + 1].append(i)

num = n
for i in range(1, m + 1):
    num -= len(d[i])
    for j in d[i]:
        st.add(L[j], 1)
        st.add(R[j] + 1, -1)

    tmp = 0
    k = i
    for j in range(k, m + 1, i):
        tmp += st.sum(j)

    print(num + tmp)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())
G = [[] for i in range(N + 1)]
for i in range(1, N):
    a = int(input())
    G[a - 1].append(i)


def dfs(v):
    if len(G[v]) == 0:
        return 0
    D = []
    for w in G[v]:
        D.append(dfs(w))

    D = sorted(D, reverse=True)

    num = 0
    for i in range(len(D)):
        num = max(num, D[i] + i + 1)

    return num


print(dfs(0))

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())
G = [[] for i in range(N + 1)]
for i in range(1, N):
    a = int(input())
    G[a - 1].append(i)


def dfs(v):
    if len(G[v]) == 0:
        return 0
    D = []
    for w in G[v]:
        D.append(dfs(w))

    D = sorted(D, reverse=True)

    num = 0
    for i in range(len(D)):
        num = max(num, D[i] + i + 1)

    return num


print(dfs(0))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())
G = [[] for i in range(N + 1)]
for i in range(1, N):
    a = int(input())
    G[a - 1].append(i)


def dfs(v):
    D = []
    for w in G[v]:
        D.append(dfs(w))

    D = sorted(D, reverse=True)

    num = 0
    for i in range(len(D)):
        num = max(num, D[i] + i + 1)

    return num


print(dfs(0))

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())
G = [[] for i in range(N + 1)]
for i in range(1, N):
    a = int(input())
    G[a - 1].append(i)


def dfs(v):
    if len(G[v]) == 0:
        return 0
    D = []
    for w in G[v]:
        D.append(dfs(w))

    D = sorted(D, reverse=True)

    num = 0
    for i in range(len(D)):
        num = max(num, D[i] + i + 1)

    return num


print(dfs(0))

Buggy python submission (verdict: Runtime Error):
N = int(input())
G = [[] for i in range(N + 1)]
for i in range(1, N):
    a = int(input())
    G[a - 1].append(i)


def dfs(v):
    D = []
    for w in G[v]:
        D.append(dfs(w))

    D = sorted(D, reverse=True)

    num = 0
    for i in range(len(D)):
        num = max(num, D[i] + i + 1)

    return num


print(dfs(0))

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())
G = [[] for i in range(N + 1)]
for i in range(1, N):
    a = int(input())
    G[a - 1].append(i)


def dfs(v):
    if len(G[v]) == 0:
        return 0
    D = []
    for w in G[v]:
        D.append(dfs(w))

    D = sorted(D, reverse=True)

    num = 0
    for i in range(len(D)):
        num = max(num, D[i] + i + 1)

    return num


print(dfs(0))
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B, C, D = map(int, input().split())


MOD = 10 ** 9 + 7
M = 100005
fact = [0] * M
fact[0] = 1
for i in range(1, M):
    fact[i] = fact[i - 1] * i
    fact[i] %= MOD

rfact = [0] * M
rfact[M - 1] = pow(fact[M - 1], MOD - 2, MOD)
for i in range(M - 2, -1, -1):
    rfact[i] = rfact[i + 1] * (i + 1)
    rfact[i] %= MOD


dp = [[0] * (N + 1) for i in range(N + 1)]
dp[A - 1][0] = 1
for i in range(A, B + 1):
    for j in range(N + 1):
        dp[i][j] += dp[i - 1][j]
        k = C
        while k <= D and j - k * i >= 0:
            dp[i][j] += dp[i - 1][j - k * i] * fact[N - (j - k * i)] * ((rfact[i]) ** k) * rfact[k] * rfact[N - j]
            dp[i][j] %= MOD
            k += 1

print(dp[B][N])


Fixed submission:
N, A, B, C, D = map(int, input().split())


MOD = 10 ** 9 + 7
M = 1005
fact = [0] * M
fact[0] = 1
for i in range(1, M):
    fact[i] = fact[i - 1] * i
    fact[i] %= MOD

rfact = [0] * M
rfact[M - 1] = pow(fact[M - 1], MOD - 2, MOD)
for i in range(M - 2, -1, -1):
    rfact[i] = rfact[i + 1] * (i + 1)
    rfact[i] %= MOD

dp = [[0] * (N + 1) for i in range(N + 1)]
dp[A - 1][0] = 1
for i in range(A, B + 1):
    for j in range(N + 1):
        dp[i][j] += dp[i - 1][j]
        k = C
        while k <= D and j - k * i >= 0:
            dp[i][j] += dp[i - 1][j - k * i] * fact[N - (j - k * i)] * pow(rfact[i], k, MOD) * rfact[k] * rfact[N - j]
            dp[i][j] %= MOD
            k += 1

print(dp[B][N])
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

parent = [i for i in range(N + M)]
rank = [0] * (N + M)


def find(i):
    if parent[i] == i:
        return i
    else:
        parent[i] = find(parent[i])
        return parent[i]


def same(x, y):
    return find(x) == find(y)


def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return

    if rank[x] > rank[y]:
        parent[y] = x
    else:
        parent[x] = y
        if rank[x] == rank[y]:
            rank[y] += 1


for i in range(N):
    P = list(map(int, input().split()))
    n = P[0]
    for j in range(1, n + 1):
        unite(N + i, P[j] - 1)


k = find(0)
for i in range(N):
    if k != find(i):
        print('NO')
        exit()

print('YES')

Fixed submission:
N, M = map(int, input().split())

parent = [i for i in range(N + M)]
rank = [0] * (N + M)


def find(i):
    if parent[i] == i:
        return i
    else:
        parent[i] = find(parent[i])
        return parent[i]


def same(x, y):
    return find(x) == find(y)


def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return

    if rank[x] > rank[y]:
        parent[y] = x
    else:
        parent[x] = y
        if rank[x] == rank[y]:
            rank[y] += 1


for i in range(N):
    P = list(map(int, input().split()))
    n = P[0]
    for j in range(1, n + 1):
        unite(i, P[j] - 1 + N)


k = find(0)
for i in range(N):
    if k != find(i):
        print('NO')
        exit()

print('YES')
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(lambda x: int(x) - 1, input().split()))
r = {}
for i in range(N):
    r[p[i]] = i

A = [30000 * i for i in range(1, N + 1)]
B = [30000 * (N - i) + r[i] for i in range(1, N + 1)]
print(A)
print(B)

Fixed submission:
N = int(input())
p = list(map(lambda x: int(x) - 1, input().split()))
r = {}
for i in range(N):
    r[p[i]] = i + 1

A = [30000 * i for i in range(1, N + 1)]
B = [30000 * (N - i) + r[i - 1] for i in range(1, N + 1)]
print(*A)
print(*B)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a, b = map(int, input().split())
for i in range(n - 1):
    c, d = map(int, input().split())
    while a * d != b * c:
        if a * d > b * c:
            b += 1
        elif a * d < b * c:
            a += 1

print(a + b)

Fixed submission:
from decimal import *
import math
n = int(input())
a, b = map(int, input().split())
for i in range(n - 1):
    c, d = map(int, input().split())
    q = Decimal(max(math.ceil(a / c), math.ceil(b / d)))
    a, b = c * q, d * q

print(a + b)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(((a + b) * h) // 2)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
print(((a + b) * c) // 2)
Buggy python submission (verdict: Time Limit Exceeded):
N, x = map(int, input().split())
a = list(map(int, input().split()))
INF = float("inf")
num = INF
rec = [INF] * N
for k in range(N):
    tmp = 0
    for j in range(N):
        rec[j] = min(rec[j], a[j - k])
        tmp += rec[j]

    num = min(tmp + k * x, num)

print(num)


Fixed submission:
N, x = map(int, input().split())
a = list(map(int, input().split()))
INF = float("inf")
num = INF
rec = [INF] * N
for k in range(N):
    tmp = 0
    for j in range(N):
        rec[j] = min(rec[j], a[j - k])
        tmp += rec[j]

    num = min(tmp + k * x, num)

print(num)
Buggy python submission (verdict: Runtime Error):
n, a = map(int, input().split())
x = list(map(int, input().split()))
X = max(max(x), a)
dp = [[[0] * (n * X + 1) for i in range(n + 1)] for j in range(n + 1)]
dp[0][0][0] = 1
for i in range(1, n + 1):
    for j in range(n + 1):
        for s in range(n * X + 1):
            if s < x[i - 1]:
                dp[i][j][s] = dp[i - 1][j][s]
            elif j >= 1 and x[i - 1] <= s:
                dp[i][j][s] = dp[i - 1][j][s] + dp[i - 1][j - 1][s - x[i - 1]]

num = 0
for i in range(1, n + 1):
    num += dp[n][i][i * a]

print(num)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(min(k, n) * x + max(0, n - k) * y)
Buggy python submission (verdict: Time Limit Exceeded):
n, a = map(int, input().split())
x = list(map(int, input().split()))
X = max(max(x), a)
dp = [[[0] * (n * X + 1) for i in range(n + 1)] for j in range(n + 1)]
dp[0][0][0] = 1
for i in range(1, n + 1):
    for j in range(n + 1):
        for s in range(n * X + 1):
            if s < x[i - 1]:
                dp[i][j][s] = dp[i - 1][j][s]
            elif j >= 1 and x[i - 1] <= s:
                dp[i][j][s] = dp[i - 1][j][s] + dp[i - 1][j - 1][s - x[i - 1]]

num = 0
for i in range(1, n + 1):
    num += dp[n][i][i * a]

print(num)

Fixed submission:
n, a = map(int, input().split())
x = list(map(lambda q: int(q) - a, input().split()))
X = max(max(x), a)
N = 2 * n * X
dp = [[0] * (N + 1) for i in range(n + 1)]
dp[0][n * X] = 1
for i in range(1, n + 1):
    for j in range(N + 1):
        if j - x[i - 1] < 0 or j - x[i - 1] > N:
            dp[i][j] = dp[i - 1][j]
        elif j - x[i - 1] <= N:
            dp[i][j] = dp[i - 1][j] + dp[i - 1][j - x[i - 1]]

print(dp[n][n * X] - 1)

Buggy python submission (verdict: Time Limit Exceeded):
n, a = map(int, input().split())
x = list(map(lambda q: int(q) - a, input().split()))
num = 0
for i in range(1, 1 << n):
    s = 0
    for j in range(n):
        if 1 << j & i:
            s += x[j]
    if s == 0:
        num += 1

print(num)

Fixed submission:
n, a = map(int, input().split())
x = list(map(lambda q: int(q) - a, input().split()))
X = max(max(x), a)
N = 2 * n * X
dp = [[0] * (N + 1) for i in range(n + 1)]
dp[0][n * X] = 1
for i in range(1, n + 1):
    for j in range(N + 1):
        if j - x[i - 1] < 0 or j - x[i - 1] > N:
            dp[i][j] = dp[i - 1][j]
        elif j - x[i - 1] <= N:
            dp[i][j] = dp[i - 1][j] + dp[i - 1][j - x[i - 1]]

print(dp[n][n * X] - 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = int(input())


def f(b, n):
    s = 0
    while n > 0:
        s += n % b
        n //= b
    return s


num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(int(N ** 0.5) + 1, 0, -1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)


Fixed submission:
N = int(input())
S = int(input())


def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n // b) + n % b


if N == S:
    print(N + 1)
    exit()
elif N < S:
    print(-1)
    exit()

num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(int(N ** 0.5) + 1, 0, -1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = int(input())


def f(b, n):
    s = 0
    while n > 0:
        s += n % b
        n //= b
    return s


num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(1, int(N ** 0.5) + 1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)

Fixed submission:
N = int(input())
S = int(input())


def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n // b) + n % b


if N == S:
    print(N + 1)
    exit()
elif N < S:
    print(-1)
    exit()

num = -1
for i in range(2, int(N ** 0.5) + 1):
    if f(i, N) == S:
        num = i
        break


if num == -1:
    for i in range(int(N ** 0.5) + 1, 0, -1):
        if (N - S) % i == 0:
            b = (N - S) // i + 1
            if f(b, N) == S:
                num = b
                break

print(num)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
a, b = -1, -1
N = len(s)
for i in range(N):
    for j in range(N):
        d = [0] * 26
        for k in range(i, j + 1):
            d[ord(s[k]) - ord("a")] += 1
        if max(d) > (j - i + 1) // 2 and j - i >= 1:
            a, b = i + 1, j + 1
            break
print(a, b)

Fixed submission:
S = input()
N = len(S)
for i in range(N - 1):
    if S[i] == S[i + 1]:
        print(i + 1, i + 2)
        exit(0)

for i in range(N - 2):
    if S[i] == S[i + 2]:
        print(i + 1, i + 3)
        exit(0)

print(-1, -1)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, X, Y, Z = map(int, input().split())
MOD = 10 ** 9 + 7

dp = [[0] * (1 << 18) for i in range(N + 1)]

ng = (1 << Z) + (1 << (Y + Z)) + (1 << (X + Y + Z))
S = (1 << (X + Y + Z + 1)) - 1
dp[0][1] = 1
for i in range(N):
    for j in range(S + 1):
        for k in range(1, 11):
            s = ((j << k) & S) + 1
            if s & ng == ng:
                continue
            dp[i + 1][s] += dp[i][j]
            dp[i + 1][s] %= MOD


ans = pow(10, N, MOD)
num = 0
for i in range(S):
    num += dp[N][i]
    num %= MOD

print((ans - num + MOD) % MOD)

Fixed submission:
N, X, Y, Z = map(int, input().split())
MOD = 10 ** 9 + 7
ng = (1 << (Z - 1)) + (1 << (Y + Z - 1)) + (1 << (X + Y + Z - 1))
S = (1 << (X + Y + Z)) - 1

dp = [[0] * (S + 1) for i in range(N + 1)]

dp[0][0] = 1
for i in range(1, N + 1):
    for j in range(S + 1):
        for k in range(1, 11):
            s = ((j << k) | 1 << k - 1) & S
            if (s & ng) == ng:
                continue
            dp[i][s] += dp[i - 1][j]
            dp[i][s] %= MOD


ans = pow(10, N, MOD)
num = 0
for i in range(S + 1):
    num += dp[N][i]
    num %= MOD

print((ans - num + MOD) % MOD)
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
cnt = 0
while X <= Y
  cnt += 1
  X *= 2
print(cnt)

Fixed submission:
X, Y = map(int, input().split())
cnt = 0
while X <= Y:
  cnt += 1
  X *= 2
print(cnt)
Buggy python submission (verdict: Runtime Error):
print("YES" if 5, 7, 5 == map(int, input().split()) else "NO")

Fixed submission:
A = sorted(list(map(int, input().split())))
print("YES" if A == [5,5,7] else "NO")

Buggy python submission (verdict: Runtime Error):
print("YES" if 5, 7, 5 == map(int, input().split()) else "NO")

Fixed submission:
A = sorted(list(map(int, input().split())))
print("YES" if A == [5,5,7] else "NO")

Buggy python submission (verdict: Runtime Error):
print("YES" is 5, 7, 5 == list(map(int, input().split())) else "NO")

Fixed submission:
A = sorted(list(map(int, input().split())))
print("YES" if A == [5,5,7] else "NO")

Buggy python submission (verdict: Runtime Error):
print("YES" is 5, 7, 5 == map(int, input().split()) else "NO")

Fixed submission:
A = sorted(list(map(int, input().split())))
print("YES" if A == [5,5,7] else "NO")
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**30)

n,k = map(int,input().split())

a = list(map(int,input().split()))

MOD = pow(10,9) + 7

p = 0

c = 0
d = 0
for i in range(n):
  for j in range(i+1,n):
    if(a[i] > a[j]):
      c += 1
      d += 1
    elif(a[i] < a[j]):
      d += 1


ans = int(c * k % MOD) + int( (k *(k-1)/2) % MOD * d)
ans = int(ans%MOD)

print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)

n,k = map(int,input().split())

a = list(map(int,input().split()))

MOD = pow(10,9) + 7

p = 0

c = 0
d = 0
for i in range(n):
  for j in range(i+1,n):
    if(a[i] > a[j]):
      c += 1
      d += 1
    elif(a[i] < a[j]):
      d += 1


ans = int(c * k % MOD) + int( (k *(k-1)//2) % MOD * d)
ans = int(ans%MOD)

print(ans)

Buggy python submission (verdict: Runtime Error):

a = list(map(int,input().split()))

MOD = pow(10,9) + 7

p = 0

c = 0
d = 0
for i in range(n):
    for j in range(i+1,n):
      if(a[i] > a[j]):
        c += 1
        d += 1
      elif(a[i] < a[j]):
        d += 1


ans = int(c * k % MOD) + int( int((k *(k-1)/2) % MOD) * d)
ans = int(ans%MOD)

print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)

n,k = map(int,input().split())

a = list(map(int,input().split()))

MOD = pow(10,9) + 7

p = 0

c = 0
d = 0
for i in range(n):
  for j in range(i+1,n):
    if(a[i] > a[j]):
      c += 1
      d += 1
    elif(a[i] < a[j]):
      d += 1


ans = int(c * k % MOD) + int( (k *(k-1)//2) % MOD * d)
ans = int(ans%MOD)

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

def addc(p,b):
  for i in e[p]:
    if(i == b):
      continue
    c[i] += c[p]
    addc(i,p)

n,q = map(int,input().split())

e = [ [] for i in range(n + 1)]
c = [0 for i in range(n + 1)]

for i in range(n-1):
  a,b = map(int,input().split())
  e[a].append(b)
  e[b].append(a)

for i in range(q):
  p,x = map(int,input().split())
  c[p] += x

addc(1,-1)

c.pop(0)

print(*c)

Fixed submission:
a = int(input())

s = input()

if(a >= 3200):
  print(s)

else:
  print("red")
Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
diff = r - l

if(diff >= 2019):
  print(0)
else:
  lmod = l % 2019
  rmod = r % 2019
  if(rmod  < lmod):
    print(0)
  else:
    ans =2020
    for i in range(l,r+1):
      for j in range(i+1,r+1):
        print("{} {}".format(i,j))
        if((i*j) % 2019 < ans):
          ans = (i*j) % 2019
    print(ans)

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

print(min(n*a,b))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())

if(a = b = c):
  print("Yes")
else:
  print("No")

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

if(a == b == c):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())

max_num = int(m/n)
ans = -1
for i in reversed(range(max_num + 1)):
  if(m % i == 0):
    ans = i
    break

print(ans)

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

max_num = int(m/n)
ans = -1
for i in reversed(range(max_num + 1)):
  if(m % i == 0):
    ans = i
    break

print(ans)

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

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

max_num = int(m/n)
ans = -1
for i in reversed(range(max_num + 1)):
  if(m % i == 0):
    ans = i
    break

print(ans)