Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))


ans = 0
for i in range(0, N-K+1):
    tmp = sum(P[i:i+K])
    if tmp > ans:
        ans = tmp
    
print((ans+K)/2)


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

acc = [0] * (N+1)
for i in range(0, N):
    acc[i+1] = acc[i] + P[i]

ans = 0
for i in range(0, N-K+1):
    tmp = acc[i+K] - acc[i]
    if tmp > ans:
        ans = tmp
    
print((ans+K)/2)
Buggy python submission (verdict: Time Limit Exceeded):
H, N = map(int, input().split())
A = []
max_A = 0
for i in range(N):
    A.append(tuple(map(int, input().split())))
    max_A = max(max_A, A[i][0])

INF = 10**9
dp = [INF] * (2 * 10 ** 4 + 1)
dp[0] = 0

for i in range(2 * 10 ** 4):
    for a, b in A:
        if i + a <= 2 * 10 ** 4:
            dp[i+a] = min(dp[i]+b, dp[i+a])

print(min(dp[H:]))

Fixed submission:
H, N = map(int, input().split())
A = []
max_A = 0
for i in range(N):
    A.append(tuple(map(int, input().split())))
    max_A = max(max_A, A[i][0])

INF = 10**9
dp = [INF] * (2 * 10 ** 4 + 1)
dp[0] = 0

for i in range(2 * 10 ** 4):
    for a, b in A:
        if i + a <= 2 * 10 ** 4:
            dp[i+a] = min(dp[i]+b, dp[i+a])

print(min(dp[H:]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

mod = 10**9 + 7
ans = 0

for d in range(60):
    n0, n1 = 0, 0
    for i in range(N):
        if (A[i] >> d) & 1:
            n1 += 1
        else:
            n0 += 1
    ans = (ans + (n0 * n1) * pow(2,d,mod))% mod
    
print(ans)

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

mod = 10**9 + 7
ans = 0

for d in range(60):
    n0, n1 = 0, 0
    for i in range(N):
        if (A[i] >> d) & 1:
            n1 += 1
        else:
            n0 += 1
    ans = (ans + (n0 * n1) * (1 << d))% mod
    
print(ans)

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

N = int(input())
A = np.array(list(map(int, input().split())))

mod = 10**9 + 7
ans = 0

for i in range(60):
    c = len(A[A&1==1])
    a >>= 1
    ans = (ans + c*(N-c)*pow(2,i,mod))%mod

print(ans)

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

mod = 10**9 + 7
ans = 0

for d in range(60):
    n0, n1 = 0, 0
    for i in range(N):
        if (A[i] >> d) & 1:
            n1 += 1
        else:
            n0 += 1
    ans = (ans + (n0 * n1) * (1 << d))% mod
    
print(ans)

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

N = int(input())
A = np.array(list(map(int, input().split())))

mod = 10**9 + 7
ans = 0

for i in range(60):
    c = len(A[A&1==1])
    ans = (ans + c*(N-c)*pow(2,i,mod))%mod
    a = a >> 1

print(ans)


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

mod = 10**9 + 7
ans = 0

for d in range(60):
    n0, n1 = 0, 0
    for i in range(N):
        if (A[i] >> d) & 1:
            n1 += 1
        else:
            n0 += 1
    ans = (ans + (n0 * n1) * (1 << d))% mod
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

mod = 10**9 + 7
ans = 0

for d in range(60):
    n0, n1 = 0, 0
    for i in range(N):
        if (A[i] >> d) & 1:
            n1 += 1
        else:
            n0 += 1
    ans = (ans + (n0 * n1) * (1 << d))% mod
    
print(ans)

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

mod = 10**9 + 7
ans = 0

for d in range(60):
    n0, n1 = 0, 0
    for i in range(N):
        if (A[i] >> d) & 1:
            n1 += 1
        else:
            n0 += 1
    ans = (ans + (n0 * n1) * (1 << d))% mod
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(A)

for _ in range(M):
    tmp = heapq.heappop(A)
    heapq.heappush(A, tmp/2)

A = map(lambda x: int(x)*(-1), A)

print(sum(A))

Fixed submission:
S = input()

if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
l_s = len(s)
l_t = len(t)

s2 = s + s
l_s2 = len(s2)

next_idx_1 = [[l_s2] * 26 for i in range(l_s2+1)]

for i in reversed(range(l_s2)):
    for j in range(26):
        next_idx_1[i][j] = next_idx_1[i+1][j]
    next_idx_1[i][ord(s2[i]) - ord("a")] = i

next_idx_2 = [[l_s2] * 26 for i in range(l_s2)]

for i in reversed(range(1, l_s2)):
    for j in range(26):
        next_idx_2[i-1][j] = next_idx_2[i][j]
    next_idx_2[i-1][ord(s2[i]) - ord("a")] = i

cur_idx = 0
for i in range(l_t):
    if i == 0:
        idx = next_idx_1[cur_idx%l_s][ord(t[i]) - ord("a")]

    else:
        idx = next_idx_2[cur_idx%l_s][ord(t[i]) - ord("a")]

    if idx == l_s2:
        print("-1")
        exit()

    cur_idx += idx - (cur_idx % l_s)
    
print(cur_idx+1)

Fixed submission:
s = input()
t = input()
l_s = len(s)
l_t = len(t)

s2 = s + s
l_s2 = len(s2)

next_idx_1 = [[l_s2] * 26 for i in range(l_s2+1)]

for i in reversed(range(l_s2)):
    for j in range(26):
        next_idx_1[i][j] = next_idx_1[i+1][j]
    next_idx_1[i][ord(s2[i]) - ord("a")] = i

next_idx_2 = [[l_s2] * 26 for i in range(l_s2)]

for i in reversed(range(1, l_s2)):
    for j in range(26):
        next_idx_2[i-1][j] = next_idx_2[i][j]
    next_idx_2[i-1][ord(s2[i]) - ord("a")] = i

cur_idx = 0
for i in range(l_t):
    if i == 0:
        idx = next_idx_1[cur_idx%l_s][ord(t[i]) - ord("a")]

    else:
        idx = next_idx_2[cur_idx%l_s][ord(t[i]) - ord("a")]

    if idx == l_s2:
        print("-1")
        exit()

    cur_idx += idx - (cur_idx % l_s)
    
print(cur_idx+1)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

N, M = map(int, input().split())
jobs = [[] for i in range(M)]

for i in range(N):
    A, B = map(int, input().split())
    if A - 1 < M:
        jobs[A-1].append(B)

q = []
ans = 0
for i in range(M):
    for j in jobs[i]:
        q.append(-j)
    heapq.heapify(q)
    if len(q) != 0:
        ans += -heapq.heappop(q)

print(ans)

Fixed submission:
import heapq

N, M = map(int, input().split())
jobs = [[] for i in range(M)]

for i in range(N):
    A, B = map(int, input().split())
    if A - 1 < M:
        jobs[A-1].append(B)

q = []
heapq.heapify(q)
ans = 0
for i in range(M):
    for j in jobs[i]:
        heapq.heappush(q, -j)
    if len(q) != 0:
        ans += -heapq.heappop(q)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import heapq

N, M = map(int, input().split())
jobs = [[] for i in range(M)]

for i in range(N):
    A, B = map(int, input().split())
    if A - 1 < M:
        jobs[A-1].append(B)

q = []
ans = 0
for i in range(M):
    for j in jobs[i]:
        q.append(-j)
    heapq.heapify(q)
    if len(q) != 0:
        ans += -heapq.heappop(q)

print(ans)

Fixed submission:
import heapq

N, M = map(int, input().split())
jobs = [[] for i in range(M)]

for i in range(N):
    A, B = map(int, input().split())
    if A - 1 < M:
        jobs[A-1].append(B)

q = []
heapq.heapify(q)
ans = 0
for i in range(M):
    for j in jobs[i]:
        heapq.heappush(q, -j)
    if len(q) != 0:
        ans += -heapq.heappop(q)

print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
M = N - K
mod = 10**9 + 7

class Combination:
    def __init__(self, n):
        self.facts = [1 for i in range(n+1)]
        self.invs = [1 for i in range(n+1)]
        
        for i in range(1, n+1):
            self.facts[i] = self.facts[i-1] * i % mod
            self.invs[i] = pow(self.facts[i], mod-2, mod)

    def ncr(self, n, r):
        return self.facts[n] * self.invs[r] * self.invs[n-r] % mod

    def nhr(self, n, r): 
        return self.ncr(n+r-1, n-1)

comb = Combination(max(M+1, K-1))

for i in range(K):
    ans = comb.ncr(M+1, i+1) * comb.ncr(K-1, i)
    print(ans%mod)

Fixed submission:
N, K = map(int, input().split())
M = N - K
mod = 10**9 + 7

class Combination:
    def __init__(self, n):
        self.facts = [1 for i in range(n+1)]
        self.invs = [1 for i in range(n+1)]
        
        for i in range(1, n+1):
            self.facts[i] = self.facts[i-1] * i % mod
            self.invs[i] = pow(self.facts[i], mod-2, mod)

    def ncr(self, n, r):
        if n < r:
            return 0
        if n < 0 or r < 0:
            return 0
        else:
            return self.facts[n] * self.invs[r] * self.invs[n-r] % mod

    def nhr(self, n, r): 
        return self.ncr(n+r-1, n-1)

comb = Combination(max(M+1, K-1))

for i in range(K):
    ans = comb.ncr(M+1, i+1) * comb.ncr(K-1, i)
    print(ans%mod)
Buggy python submission (verdict: Time Limit Exceeded):
H, W = map(int, input().split())

S = [[] for _ in range(H)]
for i in range(H):
    S[i] = input()

L = [[0] * W for _ in range(H)]
R = [[0] * W for _ in range(H)]
U = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == "." and i - 1 < 0:
            D[i][j] = 1
        elif S[i][j] == "." and i - 1 >= 0:
            D[i][j] = D[i-1][j] + 1
        if S[i][j] == "." and j - 1 < 0:
            L[i][j] = 1
        elif S[i][j] == "." and j - 1 >= 0:
            L[i][j] = L[i][j-1] + 1

for i in reversed(range(H)):
    for j in reversed(range(W)):
        if S[i][j] == "." and i + 1 >= H:
            U[i][j] = 1
        elif S[i][j] == "." and i + 1 < H:
            U[i][j] = U[i+1][j] + 1
        if S[i][j] == "." and j + 1 >= W:
            R[i][j] = 1
        elif S[i][j] == "." and j + 1 < W:
            R[i][j] = R[i][j+1] + 1

ans = 0

for i in range(H):
    for j in range(W):
        ans = max(ans, L[i][j]+R[i][j]+U[i][j]+D[i][j]-3)

print(ans)

Fixed submission:
H, W = map(int, input().split())

S = [[] for _ in range(H)]
for i in range(H):
    S[i] = input()

L = [[0] * W for _ in range(H)]
R = [[0] * W for _ in range(H)]
U = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == "." and i - 1 < 0:
            D[i][j] = 1
        elif S[i][j] == "." and i - 1 >= 0:
            D[i][j] = D[i-1][j] + 1
        if S[i][j] == "." and j - 1 < 0:
            L[i][j] = 1
        elif S[i][j] == "." and j - 1 >= 0:
            L[i][j] = L[i][j-1] + 1

for i in reversed(range(H)):
    for j in reversed(range(W)):
        if S[i][j] == "." and i + 1 >= H:
            U[i][j] = 1
        elif S[i][j] == "." and i + 1 < H:
            U[i][j] = U[i+1][j] + 1
        if S[i][j] == "." and j + 1 >= W:
            R[i][j] = 1
        elif S[i][j] == "." and j + 1 < W:
            R[i][j] = R[i][j+1] + 1

ans = 0

for i in range(H):
    for j in range(W):
        ans = max(ans, L[i][j]+R[i][j]+U[i][j]+D[i][j]-3)

print(ans)
Buggy python submission (verdict: Runtime Error):
import heapq

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

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

ans = 0
for i in range(1, K+1):
    if i > 50:
        continue
    for j in range(i+1):
        tmp = 0
        q = V[:j] + V[N-i+j:]
        heapq.heapify(q)
        for _ in range(min(i, K-i)):
            tmp_min = heapq.heappop(q)
            ans = max(ans, sum(q))
            if tmp_min > 0:
                ans = max(ans, sum(q)+tmp_min)
                break

print(ans)

Fixed submission:
import heapq

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

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

ans = 0
for i in range(1, K+1):
    if i > N:
        continue
    for j in range(i+1):
        tmp = 0
        q = V[:j] + V[N-i+j:]
        heapq.heapify(q)
        for _ in range(min(i, K-i)):
            tmp_min = heapq.heappop(q)
            ans = max(ans, sum(q))
            if tmp_min > 0:
                ans = max(ans, sum(q)+tmp_min)
                break
        ans = max(ans, sum(q))

print(ans)

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

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

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

ans = 0
for i in range(K+1):
    if i > 50:
        continue
    for j in range(i+1):
        tmp = 0
        q = V[:j] + V[N-i+j:]
        heapq.heapify(q)
        for _ in range(min(i, K-i)):
            tmp_min = heapq.heappop(q)
            ans = max(ans, sum(q))
            if tmp_min > 0:
                ans = max(ans, sum(q)+tmp_min)
                break

print(ans)

Fixed submission:
import heapq

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

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

ans = 0
for i in range(1, K+1):
    if i > N:
        continue
    for j in range(i+1):
        tmp = 0
        q = V[:j] + V[N-i+j:]
        heapq.heapify(q)
        for _ in range(min(i, K-i)):
            tmp_min = heapq.heappop(q)
            ans = max(ans, sum(q))
            if tmp_min > 0:
                ans = max(ans, sum(q)+tmp_min)
                break
        ans = max(ans, sum(q))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())

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

for i in range(N):
    w[i], v[i] = map(int, input().split())
    
for i in range(N):
    for j in range(W+1):
        if j >= w[i]:
            dp[i+1][j] = max(dp[i][j-w[i]] + v[i], dp[i][j])
        else:
            dp[i+1][j] = dp[i][j]

print(dp[N][W])

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

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

for i in range(N):
    w[i], v[i] = map(int, input().split())
    
for i in range(N):
    for j in range(W+1):
        if j >= w[i]:
            dp[i+1][j] = max(dp[i][j-w[i]] + v[i], dp[i][j])
        else:
            dp[i+1][j] = dp[i][j]

print(dp[N][W])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

left = -10**10
right = 10**10

def get_score(b):
    score = 0
    for i in range(N):
        score += abs(A[i]-b-i)
    return score

while(right > left + 1):
    mid = (left+right) // 2
    if get_score(mid+1) - get_score(mid) < 0:
        left = mid
    else:
        right = mid

print(get_score(right))
        

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

left = -10**10
right = 10**10

def get_score(b):
    score = 0
    for i in range(N):
        score += abs(A[i]-b-i)
    return score

while(right > left + 1):
    mid = (left+right) // 2
    if get_score(mid+1) - get_score(mid) < 0:
        left = mid
    else:
        right = mid

print(get_score(right))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

c = [[0]*3] * 3

for i in range(3):
    c[i] = list(map(int, input().split()))

c = np.array(c)

flg = False
for j in range(101):
    if (c[0] - j < 0).sum() >= 1:
        continue
    for k in range(101):
        if (c[1] - k < 0).sum() >= 1:
            continue
        for l in range(101):
            if (c[2] - l < 0).sum() >= 1:
                continue
            if (c[0] - j == c[1] - k).sum() == 3 and (c[1] - k == c[2] - l).sum() == 3:
                flg = True
                break

if flg:
    for j in range(101):
        if (c[:,0] - j < 0).sum() >= 1:
            continue
        for k in range(101):
            if (c[:, 1] - k < 0).sum() >= 1:
                continue
            for l in range(101):
                if (c[:, 2] - l < 0).sum() >= 1:
                    continue
                if (c[:, 0] - j == c[:,1] - k).sum() == 3 and (c[:,1] - k == c[:,2] - l).sum() == 3:
                    print("Yes")
                    exit()

print("No")



Fixed submission:
import numpy as np

c = [[0]*3] * 3

for i in range(3):
    c[i] = list(map(int, input().split()))

c = np.array(c)

if len(set(c[0] - c[1])) == 1 and len(set(c[1] - c[2])) == 1 and len(set(c[:,0] - c[:,1])) == 1 and len(set(c[:,1] - c[:,2])) == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

if A + B >= 10:
    print("error")
else:
    print(A+B)

Fixed submission:
A, B = map(int, input().split())
 
if A + B >= 10:
    print("error")
else:
    print(A+B)

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

N, A, B = map(int, input().split())

H = []

for i in range(N):
    H.append(int(input()))

H = np.array(H)

def binary_search(x):
    H_tmp = H - B * x
    H_tmp = H_tmp[H_tmp > 0]
    count = ((H_tmp + A - B - 1) // (A - B)).sum()
    return x >= count

left = 0
right = 10**10

while(right - left > 1):
    mid = (left + right) // 2
    ret = binary_search(mid)
    if ret:
        right = mid
    else:
        left = mid

print(mid)

Fixed submission:
A, B = map(int, input().split())
 
if A + B >= 10:
    print("error")
else:
    print(A+B)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
N = int(input())
D = deque()
cnt = 0
for _ in range(N):
    s = input()
    if not s in D:
        D.append(s)
print(len(D))

Fixed submission:
from collections import deque
N = int(input())
D = deque()
for _ in range(N):
    D.append(input())
print(len(set(D)))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = []
cnt = 0
for _ in range(N):
    s = input()
    if not s in L:
        L.append(s)
        cnt += 1
print(cnt)

Fixed submission:
from collections import deque
N = int(input())
D = deque()
for _ in range(N):
    D.append(input())
print(len(set(D)))
Buggy python submission (verdict: Runtime Error):
from collections import deque
S = input()
N = len(S) 
s1 = deque(S[0:int((N-1)/2)])
s2 = deque(S[int((N+3)/2)-1:N])
t1 = deque(S[0:int((N-1)/2)])
t2 = deque(S[int((N+3)/2)-1:N])

while len(s1) >= 2:
    if s1.popleft() != s2.pop():
        ans = "No"
        break
    if len(s1) == 1 or len(s1) == 0:
        ans = "preYes"
        break

if ans == "preYes":
    while len(t1) >= 2:
        if t1.pop() != t1.popleft():
            ans = "No"
            break
        if len(t1) == 1 or len(t1) == 0:
            ans = "Yes"
            break
print(ans)

Fixed submission:
from collections import deque
S = input()
N = len(S) 
s1 = deque(S[0:int((N-1)/2)])
s2 = deque(S[int((N+3)/2)-1:N])
t1 = deque(S[0:int((N-1)/2)])
t2 = deque(S[int((N+3)/2)-1:N])
ans = "None"
if len(S) == 3 and S[0] == S[2]:
    ans = "Yes"
while len(s1) >= 2:
    if s1.popleft() != s2.pop():
        ans = "No"
        break
    if len(s1) == 1 or len(s1) == 0:
        ans = "preYes"
        break

if ans == "preYes":
    while len(t1) >= 2:
        if t1.pop() != t1.popleft():
            ans = "No"
            break
        if len(t1) == 1 or len(t1) == 0:
            ans = "Yes"
            break
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import deque
S = input()
N = len(S)
DS = deque(S)    
S1 = deque(S[0:int((N-1)/2)])
S2 = deque(S[int((N+3)/2)-1:N])

s1 = S1
s2 = S2
while len(s1) >= 2:
    if s1.popleft() != s2.pop():
        ans = "No"
        break
    if len(s1) == 1 or len(s1) == 0:
        ans = "preYes"

S1 = deque(S[0:int((N-1)/2)])
S2 = deque(S[int((N+3)/2)-1:N])
if ans == "preYes":
    t1 = S1
    t2 = S2
    while len(t1) >= 2:
        if t1.pop() != t1.popleft():
            ans = "No"
            break
        if len(t1) == 1 or len(t1) == 0:
            ans = "Yes"
print(ans)

Fixed submission:
from collections import deque
S = input()
N = len(S) 
s1 = deque(S[0:int((N-1)/2)])
s2 = deque(S[int((N+3)/2)-1:N])
t1 = deque(S[0:int((N-1)/2)])
t2 = deque(S[int((N+3)/2)-1:N])
ans = "None"
if len(S) == 3 and S[0] == S[2]:
    ans = "Yes"
while len(s1) >= 2:
    if s1.popleft() != s2.pop():
        ans = "No"
        break
    if len(s1) == 1 or len(s1) == 0:
        ans = "preYes"
        break

if ans == "preYes":
    while len(t1) >= 2:
        if t1.pop() != t1.popleft():
            ans = "No"
            break
        if len(t1) == 1 or len(t1) == 0:
            ans = "Yes"
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
i = N
count = 1
while i >= K:
    i //= K
    count += 1
print(count)

Fixed submission:
N, R = map(int, input().split())
if N >= 10:
    print(R)
elif N < 10:
    print(R + (100*(10-N)))
Buggy python submission (verdict: Runtime Error):
n = 0
for i in range(10):
    n += c[i]
if n > 3:
    cnt += math.floor(n / 4)

print(cnt)
#
A, B, C = map(int, input().split())
L = []
for i in A,B,C:
    L.append(i)
Ls = sorted(L)
if Ls[0] == 5 and Ls[1] == 5 and Ls[2] == 7:
    print("Yes")
else:
    print("No")

Fixed submission:
A, B, C = map(int, input().split())
L = []
for i in A,B,C:
    L.append(i)
Ls = sorted(L)
if Ls[0] == 5 and Ls[1] == 5 and Ls[2] == 7:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input()split())
     
print(A* B)

Fixed submission:
A, B = map(int, input().split())
     
print(A* B)

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input()split())

print(A* B)

Fixed submission:
A, B = map(int, input().split())
     
print(A* B)
Buggy python submission (verdict: Time Limit Exceeded):
T = input()
t = list(T)
que = t.count("?")

for i in range(que):
  m = t.index("?")
  t[m] = "D"

s = ""  
while t:
  s+= t.pop(0)
  
print(s)

Fixed submission:
T = input()
D = T.replace("?","D")

print(D)
Buggy python submission (verdict: Time Limit Exceeded):
def mincuota(listas, N, M, X):
  for i in range(1, M+ 1):
    skill = 0
    for j in range(N):
      skill+= listas[j][i]
    if(skill < X):
      return -1
  else:
    newcuotas = []
    for i in range(N):
      newlistas = listas[:i]+ listas[i+ 1:]
      if(mincuota(newlistas, N- 1, M, X) != -1):
        newcuotas.append(mincuota(newlistas, N- 1, M, X))
    if(newcuotas == []):
      cuota = 0
      for i in range(N):
        cuota+= listas[i][0]
      return cuota
    else:
      return min(newcuotas)
  
N, M, X = map(int, input().split())
listas = []
for i in range(N):
  listas.append(list(map(int, input().split())))

  
print(mincuota(listas, N, M, X))

Fixed submission:
def twodig(x, N):
  l = list(bin(x))
  n = len(l)- 2
  ans = []
  for i in range(N- n):
    ans.append(0)
  for i in range(2, n+ 2):
    ans.append(int(l[i]))
  return ans

N, M, X = map(int, input().split())
lista = []
for i in range(N):
  lista.append(list(map(int, input().split())))
  
count = 1
ans = []

for i in range(2** N):
  flag = 0
  r = twodig(count, N)
  newlista = []
  c = r.count(1)
  for j in range(c):
    index = r.index(1)
    r[index] = 0
    newlista.append(lista[index])
  for k in range(1, M+ 1):
    summ = 0
    for l in range(c):
      summ+= newlista[l][k]
    if(summ < X):
      ans.append(-1)
      flag = 1
      break
  if(flag == 1):
    count+= 1
    continue
  else:
    cuota = 0
    for i in range(c):
      cuota+= newlista[i][0]
    ans.append(cuota)
    count+= 1
    
Ans = list(filter(lambda x: x!= -1, ans))

if(Ans == []):
  print(-1)
else:
  print(min(Ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
l = list(map(int, input().split()))
deltatemperature = []

for height in l:
  deltatemperature.append(abs(T- height* 0.006- A))
  
m = min(deltatemperature)
mindex = l.index(m)
print(mindex+ 1)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
l = list(map(int, input().split()))
deltatemperature = []

for height in l:
  deltatemperature.append(abs(T- height* 0.006- A))
  
m = min(deltatemperature)
mindex = deltatemperature.index(m)
print(mindex+ 1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def drawal(x):
  if(x <= 5):
    return x
  else:
    def drawal9(y):
      i = 0
      while 9** (i+ 1)<= y:
        i+= 1
      return drawal(y- 9** i)+ 1
    def drawal6(z):
      i = 0
      while 6** (i+ 1)<= z:
        i+= 1
      return drawal(z- 6** i)+ 1
    return min(drawal9(x), drawal6(x))

print(drawal(N))

Fixed submission:
N = int(input())

def drawal(x):
  if(x <= 5):
    return x
  elif(6<= x and x < 9):
    return x- 5
  elif(9<= x and x < 15):
    return x- 8
  else:
    def drawal9(y):
      i = 0
      while 9** (i+ 1)<= y:
        i+= 1
      return drawal(y- 9** i)+ 1
    def drawal6(z):
      i = 0
      while 6** (i+ 1)<= z:
        i+= 1
      return drawal(z- 6** i)+ 1
    return min(drawal9(x), drawal6(x))

print(drawal(N))