Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = []
for i in range(N):
    A_i = list(map(int, input().split()))
    A.append(A_i)
A = np.array(A)

#ans = list((A@B) > -C).count(True)
ans = list((np.matmul(A, B)) > -C).count(True)

print(ans)


Fixed submission:
import numpy as np

N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = []
for i in range(N):
    A_i = list(map(int, input().split()))
    A.append(A_i)
A = np.array(A)

#ans = list((A@B) > -C).count(True)
ans = list((A.dot(B)) > -C).count(True)

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = []
for i in range(N):
    A_i = list(map(int, input().split()))
    A.append(A_i)
A = np.array(A)

ans = list((A@B) > -C).count(True)
print(ans)


Fixed submission:
import numpy as np

N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = []
for i in range(N):
    A_i = list(map(int, input().split()))
    A.append(A_i)
A = np.array(A)

#ans = list((A@B) > -C).count(True)
ans = list((A.dot(B)) > -C).count(True)

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = []
for i in range(N):
    A_i = list(map(int, input().split()))
    A.append(A_i)
A = np.array(A)

ans = list((A@B) > -C).count(True)
print(ans)


Fixed submission:
import numpy as np

N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = []
for i in range(N):
    A_i = list(map(int, input().split()))
    A.append(A_i)
A = np.array(A)

#ans = list((A@B) > -C).count(True)
ans = list((A.dot(B)) > -C).count(True)

print(ans)
Buggy python submission (verdict: Runtime Error):
s = sorted(input())
t = sorted(input())[:: -1]
print("Yes" if s < t else "No")


Fixed submission:
S = input()
print('Heisei' if S <= '2019/04/30' else 'TBD')
Buggy python submission (verdict: Runtime Error):
p = {"JPY": 0, "BTC": 0}
for _ in range(int(input())):
    price, currency = input().split()
    price = int(price)
    p[currency] += price

print(p["JPY"] + 380000.0 * p["BTC"])

Fixed submission:
p = {"JPY": 0, "BTC": 0}
for _ in range(int(input())):
    price, currency = input().split()
    price = float(price)
    p[currency] += price

print(p["JPY"] + 380000.0 * p["BTC"])
Buggy python submission (verdict: Runtime Error):
s = int(input())
rec = {}


def f(x):
    if x % 2 == 0:
        return x//2
    else:
        return 3*x + 1


c = 0
while True:
    if s in rec:
        print(c)
        exit()
    rec.add(s)
    s = f(s)
    c += 1


Fixed submission:
s = int(input())
rec = set()


def f(x):
    if x % 2 == 0:
        return x//2
    else:
        return 3*x + 1


c = 1
while True:
    if s in rec:
        print(c)
        exit()
    rec.add(s)
    s = f(s)
    c += 1
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
dp = [float('inf')] * N
dp[0] = 0
dp[1] = abs(H[1] - H[0])


def rec(i):
    if dp[i] != float('inf'):
        return dp[i]
    else:
        dp[i] = min(rec(i-1) + abs(H[i]-H[i-1]), rec(i-2) + abs(H[i]-H[i-2]))
        return dp[i]


# print(*dp)
print(rec(N-1))


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
dp = [float('inf')] * N
dp[0] = 0
for i in range(1, N):
    dp[i] = min(dp[i-1] + abs(H[i]-H[i-1]), dp[i-2] + abs(H[i]-H[i-2])
                ) if i >= 2 else dp[i-1] + abs(H[i] - H[i-1])
#print(*dp)
print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
W = []
V = []
for _ in range(N):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

VMAX = 10**4 + 100
ans = 0
dp = [[float('inf')] * (VMAX+1) for _ in range(N+1)]
dp[0][0] = 0
for n in range(N):
    for v in range(VMAX):
        if dp[n][v] != float('inf'):
            dp[n+1][v] = min(dp[n+1][v], dp[n][v])
            dp[n+1][v+V[n]] = min(dp[n+1][v+V[n]], dp[n][v] + W[n])

            if dp[n+1][v+V[n]] <= L:
                ans = max(ans, v+V[n])
# print(*dp, sep='\n')
print(ans)


Fixed submission:
N, L = map(int, input().split())
W = []
V = []
for _ in range(N):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

VMAX = 10**5 + 100
ans = 0
dp = [[float('inf')] * (VMAX+1) for _ in range(N+1)]
dp[0][0] = 0
for n in range(N):
    for v in range(VMAX):
        if dp[n][v] != float('inf'):
            dp[n+1][v] = min(dp[n+1][v], dp[n][v])
            dp[n+1][v+V[n]] = min(dp[n+1][v+V[n]], dp[n][v] + W[n])

            if dp[n+1][v+V[n]] <= L:
                ans = max(ans, v+V[n])
# print(*dp, sep='\n')
print(ans)

Buggy python submission (verdict: Runtime Error):
N, W = map(int, input().split())
T = [list(map(int, input().split())) for _ in range(N)]

dp = [[0] + [-1] * W for _ in range(N+1)]
dp[0] = [0] * (W+1)

for i in range(1, N+1):
    for w in range(1, W+1):
        dp[i][w] = max(dp[i-1][w], dp[i-1][w - T[i-1][0]] + T[i-1]
                       [1]) if w - T[i-1][0] >= 0 else dp[i-1][w]

# print(*dp, sep='\n')
print(dp[N][W])


Fixed submission:
N, L = map(int, input().split())
W = []
V = []
for _ in range(N):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

VMAX = 10**5 + 100
ans = 0
dp = [[float('inf')] * (VMAX+1) for _ in range(N+1)]
dp[0][0] = 0
for n in range(N):
    for v in range(VMAX):
        if dp[n][v] != float('inf'):
            dp[n+1][v] = min(dp[n+1][v], dp[n][v])
            dp[n+1][v+V[n]] = min(dp[n+1][v+V[n]], dp[n][v] + W[n])

            if dp[n+1][v+V[n]] <= L:
                ans = max(ans, v+V[n])
# print(*dp, sep='\n')
print(ans)

Buggy python submission (verdict: Runtime Error):
N, W = map(int, input().split())
T = [list(map(int, input().split())) for _ in range(N)]

dp = [[0] + [-1] * W for _ in range(N+1)]
dp[0] = [0] * (W+1)

for i in range(1, N+1):
    for w in range(1, W+1):
        dp[i][w] = max(dp[i-1][w], dp[i-1][w - T[i-1][0]] + T[i-1]
                       [1]) if w - T[i-1][0] >= 0 else dp[i-1][w]

# print(*dp, sep='\n')
print(dp[N][W])


Fixed submission:
N, L = map(int, input().split())
W = []
V = []
for _ in range(N):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

VMAX = 10**5 + 100
ans = 0
dp = [[float('inf')] * (VMAX+1) for _ in range(N+1)]
dp[0][0] = 0
for n in range(N):
    for v in range(VMAX):
        if dp[n][v] != float('inf'):
            dp[n+1][v] = min(dp[n+1][v], dp[n][v])
            dp[n+1][v+V[n]] = min(dp[n+1][v+V[n]], dp[n][v] + W[n])

            if dp[n+1][v+V[n]] <= L:
                ans = max(ans, v+V[n])
# print(*dp, sep='\n')
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**8)
N, M = map(int, input().split())
G = dict([[i, []] for i in range(N)])
for _ in range(M):
    x, y = map(int, input().split())
    G[x-1].append(y-1)

dp = [-1] * N


def rec(v):
    if dp[v] >= 0:
        return dp[v]
    if len(G[v]) == 0:
        return 0

    ret = -1
    for nv in G[v]:
        ret = max(ret, rec(nv) + 1)

    return ret


print(max([rec(v) for v in range(N)]))


Fixed submission:
import sys
sys.setrecursionlimit(10**8)
N, M = map(int, input().split())
G = dict([[i, []] for i in range(N)])
for _ in range(M):
    x, y = map(int, input().split())
    G[x-1].append(y-1)

dp = [-1] * N


def rec(v):
    if dp[v] >= 0:
        return dp[v]
    if len(G[v]) == 0:
        return 0

    ret = -1
    for nv in G[v]:
        ret = max(ret, rec(nv) + 1)

    dp[v] = ret
    return ret


print(max([rec(v) for v in range(N)]))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**8)
N, M = map(int, input().split())
G = dict([[i, []] for i in range(N)])
for _ in range(M):
    x, y = map(int, input().split())
    G[x-1].append(y-1)

dp = [-1] * N


def rec(v):
    if dp[v] >= 0:
        return dp[v]
    if len(G[v]) == 0:
        return 0

    ret = -1
    for nv in G[v]:
        ret = max(ret, rec(nv) + 1)

    return ret


print(max([rec(v) for v in range(N)]))


Fixed submission:
import sys
sys.setrecursionlimit(10**8)
N, M = map(int, input().split())
G = dict([[i, []] for i in range(N)])
for _ in range(M):
    x, y = map(int, input().split())
    G[x-1].append(y-1)

dp = [-1] * N


def rec(v):
    if dp[v] >= 0:
        return dp[v]
    if len(G[v]) == 0:
        return 0

    ret = -1
    for nv in G[v]:
        ret = max(ret, rec(nv) + 1)

    dp[v] = ret
    return ret


print(max([rec(v) for v in range(N)]))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
G = dict([[i, []] for i in range(N)])
for _ in range(M):
    x, y = map(int, input().split())
    G[x-1].append(y-1)

dp = [-1] * N


def rec(v):
    if dp[v] >= 0:
        return dp[v]
    if len(G[v]) == 0:
        return 0

    ret = -1
    for nv in G[v]:
        ret = max(ret, rec(nv) + 1)

    return ret


print(max([rec(v) for v in range(N)]))


Fixed submission:
import sys
sys.setrecursionlimit(10**8)
N, M = map(int, input().split())
G = dict([[i, []] for i in range(N)])
for _ in range(M):
    x, y = map(int, input().split())
    G[x-1].append(y-1)

dp = [-1] * N


def rec(v):
    if dp[v] >= 0:
        return dp[v]
    if len(G[v]) == 0:
        return 0

    ret = -1
    for nv in G[v]:
        ret = max(ret, rec(nv) + 1)

    dp[v] = ret
    return ret


print(max([rec(v) for v in range(N)]))
Buggy python submission (verdict: Runtime Error):
print(int(input()) + int(input())//2)


Fixed submission:
x, y = map(int, input().split())
print(x + y//2)
Buggy python submission (verdict: Runtime Error):
print("Yes" if (int(input())*int(input())) % 2 != 0 else "No")


Fixed submission:
a, b = map(int, input().split())
print("Yes" if a*b % 2 != 0 else "No")

Buggy python submission (verdict: Runtime Error):
print("Yes" if (int(input)*int(input)) % 2 != 0 else "No")


Fixed submission:
a, b = map(int, input().split())
print("Yes" if a*b % 2 != 0 else "No")

Buggy python submission (verdict: Runtime Error):
print("Yes" if int(input)*int(input) % 2 != 0 else "No")


Fixed submission:
a, b = map(int, input().split())
print("Yes" if a*b % 2 != 0 else "No")
Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
N, K = map(int, input().split())
X = sorted(list(map(int, input().split())) + [K])
# print(X)
S = [X[i+1] - X[i] for i in range(N)]
# print(S)
D = reduce(gcd, S, S[0])
print(D)


Fixed submission:
from functools import reduce
from fractions import gcd
N, K = map(int, input().split())
X = sorted(list(map(int, input().split())) + [K])
# print(X)
S = [X[i+1] - X[i] for i in range(N)]
# print(S)
D = reduce(gcd, S, S[0])
print(D)

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
N, K = map(int, input().split())
X = sorted(list(map(int, input().split())) + [K])
# print(X)
S = [X[i+1] - X[i] for i in range(N)]
# print(S)
D = reduce(gcd, S, S[0])
print(D)


Fixed submission:
from functools import reduce
from fractions import gcd
N, K = map(int, input().split())
X = sorted(list(map(int, input().split())) + [K])
# print(X)
S = [X[i+1] - X[i] for i in range(N)]
# print(S)
D = reduce(gcd, S, S[0])
print(D)
Buggy python submission (verdict: Runtime Error):
print((int(input())-1)*(int(input())-1))


Fixed submission:
a, b = map(int, input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = ""
while N:
     S = chr(N % (-2)) + S
     N /= (-2)
print(S)
    

Fixed submission:
N = int(input())
S = ""
while N != 0:
    if N % 2 != 0:
        N -= 1
        S = "1" + S
    else:
        S = "0" + S
    N //= (-2)
print(S if S != "" else "0")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
print("Yay!" if A <= 8 and B <= 8)


Fixed submission:
A, B = map(int, input().split())
print("Yay!" if A <= 8 and B <= 8 else ":(")
Buggy python submission (verdict: Runtime Error):
D, N = int(input())
print(100*(D+N) if D > 0 else N)


Fixed submission:
D, N = map(int, input().split())
print(N*100**D if N < 100 else (N+1)*100**D)
Buggy python submission (verdict: Runtime Error):
import numpy as np
X = int(input())
ans = 1
for b in range(int(np.ceil(np.sqrt(X)))):
    p = 0
    while np.pow(b, p) <= X:
        p += 1
    p -= 1
    ans = max(ans, np.pow(b, p))
print(ans)


Fixed submission:
import numpy as np
X = int(input())
ans = 1
for b in range(2, 1+int(np.ceil(np.sqrt(X)))):
    p = 0
    while np.power(b, p) <= X:
        p += 1
    p -= 1
    ans = max(ans, np.power(b, p))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
X = int(input())
ans = 1
for b in range(int(np.ceil(np.sqrt(X)))):
    p = 0
    while b**p <= X:
        p += 1
    p -= 1
    ans = max(ans, b**p)
print(ans)


Fixed submission:
import numpy as np
X = int(input())
ans = 1
for b in range(2, 1+int(np.ceil(np.sqrt(X)))):
    p = 0
    while np.power(b, p) <= X:
        p += 1
    p -= 1
    ans = max(ans, np.power(b, p))
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
X = int(input())
ans = 1
for b in range(np.ceil(np.sqrt(X))):
    p = 0
    while b**p <= X:
        p += 1
    p -= 1
    ans = max(ans, b**p)
print(ans)


Fixed submission:
import numpy as np
X = int(input())
ans = 1
for b in range(2, 1+int(np.ceil(np.sqrt(X)))):
    p = 0
    while np.power(b, p) <= X:
        p += 1
    p -= 1
    ans = max(ans, np.power(b, p))
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
X = int(input())
for b in range(np.ceil(np.sqrt(X))):
    p = 0
    while b**p <= X:
        p += 1
    p -= 1
    ans = max(ans, b**p)
print(ans)


Fixed submission:
import numpy as np
X = int(input())
ans = 1
for b in range(2, 1+int(np.ceil(np.sqrt(X)))):
    p = 0
    while np.power(b, p) <= X:
        p += 1
    p -= 1
    ans = max(ans, np.power(b, p))
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M, X = map(int, input().split())
A = map(int, input().split())


def ssum(A, l, r):
    ssum = 0
    for i in range(l, r):
        ssum += A[i]
    return ssum


print(min(ssum(A, 0, X), ssum(A, X, N+1)))


Fixed submission:
N, M, X = map(int, input().split())
A = sorted(list(map(int, input().split())))

l = 0
r = 0
for a in A:
    if(a < X):
        l += 1
    else:
        r += 1

print(min(l, r))
Buggy python submission (verdict: Runtime Error):
import bisect
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X.copy())
for x in X:
    print(Y[N//2-1] if bisect.bisect(Y, x) >= N//2 else Y[N//2])


Fixed submission:
import bisect
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X.copy())
for x in X:
    print(Y[N//2-1] if bisect.bisect(Y, x) > N//2 else Y[N//2])

Buggy python submission (verdict: Runtime Error):
import bisect
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X.copy())
for x in X:
    print(Y[N//2-1] if bisect.bisect(Y, x) >= N//2 else Y[N//2])


Fixed submission:
import bisect
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X.copy())
for x in X:
    print(Y[N//2-1] if bisect.bisect(Y, x) > N//2 else Y[N//2])
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input())
S = sorted(set(list(range(A, B+1)[:K]) + list(range(A, B+1)[-K:])))
print(*S, sep="\n")


Fixed submission:
A, B, K = map(int, input().split())
S = sorted(set(list(range(A, B+1)[:K]) + list(range(A, B+1)[-K:])))
print(*S, sep="\n")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
print([0 <= X - 500*a - 100*b and X - 500*a - 100*b %
       50 == 0 and X - 500*a - 100*b // 50 <= C for a in A for b in B].count(True))


Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
print([0 <= X - 500*a - 100*b and (X - 500*a - 100*b) %
       50 == 0 and (X - 500*a - 100*b) // 50 <= C for a in range(A+1) for b in range(B+1)].count(True))
Buggy python submission (verdict: Runtime Error):
N = 10*(int(input())) + int(input())
if N % 1:
    print("Yes")
else:
    print("No")


Fixed submission:
A, B = input().split()
N = int(A + B)
if (N**0.5) % 1:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
A, B = input().split()
S1, S2 = input().split("-")
print("Yes" if len(S1) == A and len(S2) == B else "No")


Fixed submission:
A, B = map(int, input().split())
S = input().split("-")
print("Yes" if len(S) == 2 and len(S[0]) == A and len(S[1]) == B else "No")
Buggy python submission (verdict: Runtime Error):
s = sorted(input())
t = sorted(input()).reverse()
print("Yes" if s < t else "No")


Fixed submission:
s = sorted(input())
t = sorted(input())[:: -1]
print("Yes" if s < t else "No")

Buggy python submission (verdict: Runtime Error):
s = sorted([char for char in input()])
t = sorted([char for char in input()]).reverse()
print("Yes" if s < t else "No")


Fixed submission:
s = sorted(input())
t = sorted(input())[:: -1]
print("Yes" if s < t else "No")

Buggy python submission (verdict: Runtime Error):
s = sorted(list(map(str, input().split(""))))
t = sorted(list(map(str, input().split("")))).reverse()
print("Yes" if s < t else "No")


Fixed submission:
s = sorted(input())
t = sorted(input())[:: -1]
print("Yes" if s < t else "No")

Buggy python submission (verdict: Runtime Error):
s = sorted(input())
t = sorted(input()).reverse()
print("Yes" if s < t else "No")


Fixed submission:
s = sorted(input())
t = sorted(input())[:: -1]
print("Yes" if s < t else "No")
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split(" "))
print("<" if X < Y else "=" if X == Y else ">")


Fixed submission:
X, Y = input().split(" ")
print("<" if X < Y else "=" if X == Y else ">")

Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split(" "))
print("<" if X < Y else "=" if X == Y else Y)


Fixed submission:
X, Y = input().split(" ")
print("<" if X < Y else "=" if X == Y else ">")
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = sorted(list(map(int, input().split())))
M = int(input())
T = sorted(list(map(int, input().split())))
C = [0] * 3*10**5
for d in D:
    if d in C:
        C[d] += 1
    else:
        C[d] = 1
E = [0] * 3*10**5
for t in T:
    if t in E:
        E[t] += 1
    else:
        E[t] = 1
for key, val in enumerate(E):
    if val != 0:
        C[key] //= val

print('YES' if min(C[t] for t in T if t) > 0 else 'NO')


Fixed submission:
N = int(input())
D = sorted(list(map(int, input().split())))
M = int(input())
T = sorted(list(map(int, input().split())))
C = {}
for d in D:
    if d in C:
        C[d] += 1
    else:
        C[d] = 1
E = {}
for t in T:
    if t in E:
        E[t] += 1
    else:
        E[t] = 1
for key, val in E.items():
    if key in C:
        C[key] //= val

print('YES' if min([C[t] if t in C else 0 for t in T]) > 0 else 'NO')
Buggy python submission (verdict: Runtime Error):
A = set()
for i in range(int(input())):
    a = int(input())
    A ^= set(a)
print(len(A))

Fixed submission:
A = set()
for i in range(int(input())):
    A ^= set([int(input())])
print(len(A))
Buggy python submission (verdict: Runtime Error):
S = input()
while len(S):
    S.pop()
    if S[:len(S)//2+1] == S[len(S)//2+1:]:
        print(len(S[:len(S)//2+1]))
        exit()


Fixed submission:
S = [c for c in input()]
while len(S):
    S.pop()
    if len(S) % 2 == 0 and S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(N):
    if (i+1) % 2 == N % 2:
        ans = [a[i]] + ans
    else:
        ans = ans + [a[i]]
print(*ans, sep=" ")


Fixed submission:
from collections import deque
N = int(input())
a = list(map(int, input().split()))
ans = deque([])
for i in range(N):
    if (i+1) % 2 == N % 2:
        ans.appendleft(a[i])
    else:
        ans.append(a[i])
print(*ans, sep=" ")

Buggy python submission (verdict: Runtime Error):
 n = int(input())
 a = list(map(int, input().split()))
 ans = []
 for i in range(N):
    if (i+1) % 2 == N % 2:
         ans = [a.pop(0)] + ans
    else:
         ans = ans + [a.pop()]
print(*ans, sep=" ")

Fixed submission:
from collections import deque
N = int(input())
a = list(map(int, input().split()))
ans = deque([])
for i in range(N):
    if (i+1) % 2 == N % 2:
        ans.appendleft(a[i])
    else:
        ans.append(a[i])
print(*ans, sep=" ")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
C = [0] * 9
for a in A:
    C[a//400] += 1
s = sum([c > 0 for c in C[:-1]])
print(max(s, 1), min(9, s + C[-1]))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
C = [0] * 9
for a in A:
    C[min(8, a//400)] += 1
s = sum([c > 0 for c in C[:-1]])
# print(C)
print(max(s, 1), s + C[-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = sorted([int(input()) for _ in range(N)])
s = sum(S)
if s % 10 != 0:
    print(s)
    exit()

for si in range(S):
    if si % 10 != 0:
        print(s - si)
        exit()

print(0)


Fixed submission:
N = int(input())
S = sorted([int(input()) for _ in range(N)])
s = sum(S)
if s % 10 != 0:
    print(s)
    exit()

for si in S:
    if si % 10 != 0:
        print(s - si)
        exit()

print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = sorted([int(input()) for _ in range(N)])
if all([s % 10 == 0 for s in S]):
    print(0)

for i in range(1 << N):
    s = sum(S)
    for j in range(N):
        if i & 1 << j:
            s -= S[j]
    # print(bin(i), s)
    if s % 10 != 0:
        print(s)
        break


Fixed submission:
N = int(input())
S = sorted([int(input()) for _ in range(N)])
s = sum(S)
if s % 10 != 0:
    print(s)
    exit()

for si in S:
    if si % 10 != 0:
        print(s - si)
        exit()

print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = sorted([int(input()) for _ in range(N)])

for i in range(1 << N):
    s = sum(S)
    for j in range(N):
        if i & 1 << j:
            s -= S[j]
    # print(bin(i), s)
    if s % 10 != 0:
        print(s)
        break
else:
    print(0)


Fixed submission:
N = int(input())
S = sorted([int(input()) for _ in range(N)])
s = sum(S)
if s % 10 != 0:
    print(s)
    exit()

for si in S:
    if si % 10 != 0:
        print(s - si)
        exit()

print(0)
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
print("EQUAL" if A==B else "GREATER" if A>B else "LESS")

Fixed submission:
A = int(input())
B = int(input())
print("EQUAL" if A == B else "GREATER" if A > B else "LESS")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
S = [list(input().split()) for _ in range(N)]
C = [list(input().split()) for _ in range(M)]
for a, b in S:
    dist = [abs(a-c) + abs(b-d) for c, d in C]
    print(dist[dist.index(min(dist))])


Fixed submission:
N, M = map(int, input().split())
S = [list(map(int, input().split())) for _ in range(N)]
C = [list(map(int, input().split())) for _ in range(M)]
for a, b in S:
    dist = [abs(a-c) + abs(b-d) for c, d in C]
    print(dist.index(min(dist))+1)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
ans = math.inf
for i in range(1, 1+math.floor(math.sqrt(N))):
    if N % i == 0:
        ans = min(ans, len(str(N//i)))
print(ans)


Fixed submission:
import math
N = int(input())
ans = N
for i in range(1, 1+math.floor(math.sqrt(N))):
    if N % i == 0:
        ans = min(ans, len(str(N//i)))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
ans = math.inf
for i in range(1, 1+math.floor(math.sqrt(N))):
    if N % i == 0:
        ans = min(ans, len(str(N/i)))
print(ans)


Fixed submission:
import math
N = int(input())
ans = N
for i in range(1, 1+math.floor(math.sqrt(N))):
    if N % i == 0:
        ans = min(ans, len(str(N//i)))
print(ans)