Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import heapq
from collections import defaultdict

# 3種類のケーキを美味しい順にソートする
x, y, z, k = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)


# heapqで管理
que = []
heapq.heapify(que)
# 最も美味しい組み合わせは、
heapq.heappush(que, ((A[0] + B[0] + C[0])*-1, (0, 0, 0)))

# 使用した組み合わせ
used = defaultdict(int)
used[(0, 0, 0)] = 1

ans = []
while len(ans) < k:
    total, comb = heapq.heappop(que)
    ans.append(total*-1)
    a, b, c = comb
    # その次に美味しい組み合わせは、以下のいずれか
    for p, q, r in [[a+1, b, c], [a, b+1, c], [a, b, c+1]]:
        if used[(p, q, r)] == 0:
            heapq.heappush(que, ((A[p] + B[q] + C[r])*-1, (p, q, r)))
            used[(p, q, r)] = 1

for i in range(k):
    print(ans[i])

Fixed submission:
import heapq

x, y, z, k = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

# A+B+Cが大きい順になるようにリストに入れていく
ABC = []

# heapqに任意の値が入っているか確認する
from collections import defaultdict
d = defaultdict(int)

que = []

def HeapPush(a, b, c):
    if d[(a, b, c)] == 0:
        heapq.heappush(que, ((A[a] + B[b] + C[c])*-1, a, b, c))  # -1を掛ける
        d[(a, b, c)] += 1


HeapPush(0, 0, 0)

while len(ABC) < k:
    
    abc, a, b, c = heapq.heappop(que)
    ABC.append(abc*-1)  # -1を掛け直す
    
    if a + 1 < x:
        HeapPush(a+1, b, c)
    if b + 1 < y:
        HeapPush(a, b+1, c)
    if c + 1 < z:
        HeapPush(a, b, c+1)
   

for abc in ABC:
    print(abc)

Buggy python submission (verdict: Time Limit Exceeded):
x, y, z, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

AB = []
for a in A:
    for b in B:
        AB.append(a + b)
AB = sorted(AB, reverse=True)[:k]

ABC = []
for c in C:
    for ab in AB:
        ABC.append(ab + c)
ABC = sorted(ABC, reverse=True)[:k]

for abc in ABC:
    print(abc)

Fixed submission:
import heapq

x, y, z, k = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

# A+B+Cが大きい順になるようにリストに入れていく
ABC = []

# heapqに任意の値が入っているか確認する
from collections import defaultdict
d = defaultdict(int)

que = []

def HeapPush(a, b, c):
    if d[(a, b, c)] == 0:
        heapq.heappush(que, ((A[a] + B[b] + C[c])*-1, a, b, c))  # -1を掛ける
        d[(a, b, c)] += 1


HeapPush(0, 0, 0)

while len(ABC) < k:
    
    abc, a, b, c = heapq.heappop(que)
    ABC.append(abc*-1)  # -1を掛け直す
    
    if a + 1 < x:
        HeapPush(a+1, b, c)
    if b + 1 < y:
        HeapPush(a, b+1, c)
    if c + 1 < z:
        HeapPush(a, b, c+1)
   

for abc in ABC:
    print(abc)
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()

lr = [list(map(int, input().split()))for _ in range(q)]

for l, r in lr:
    print(s[l-1:r].count('AC'))

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

# 'AC'の累積和を求める
d = [0]*n
for i in range(1, n):
    d[i] += d[i-1]
    if s[i-1] == 'A' and s[i] == 'C':
        d[i] += 1
        
lr = [list(map(int, input().split())) for _ in range(q)]
for l, r in lr:
    print(d[r-1] - d[l-1])
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
 
d1 = [i for i in range(1, a//2+2) if a%i == 0]
d2 = [i for i in range(1, b//2+2) if b%i == 0]
print(sorted(set(d1) & set(d2))[k-1])

Fixed submission:
a, b, k = map(int, input().split())
 
def get_divisors(n):
    return [i for i in range(1, n//2+1) if n%i == 0] + [n]

print(sorted(set(get_divisors(a)) & set(get_divisors(b)), reverse=True)[k-1])

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

d1 = [i for i in range(1, a//2+2) if a%i == 0]
d2 = [i for i in range(1, b//2+2) if a%i == 0]
print(sorted(set(d1) & set(d2))[k-1])

Fixed submission:
a, b, k = map(int, input().split())
 
def get_divisors(n):
    return [i for i in range(1, n//2+1) if n%i == 0] + [n]

print(sorted(set(get_divisors(a)) & set(get_divisors(b)), reverse=True)[k-1])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H = list(map(int, input().split()))

dp = [10**9]*N
dp[0] = 0

for i in range(1, N):
    for k in range(1, K+1):
        if i - k >= 0:
            dp[i] = min(dp[i], dp[i - k]+abs(H[i] - H[i - k]))
        else:
            break
print(dp[-1])

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

dp = [10**9]*N
dp[0] = 0

for i in range(1, N):
    for k in range(1, K+1):
        if i - k >= 0:
            dp[i] = min(dp[i], dp[i - k]+abs(H[i] - H[i - k]))
        else:
            break
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
act = [list(map(int, input().split())) for _ in range(N)]
 
import numpy as np
act = np.array(act)
act = np.concatenate([[[0]*3], act])  # 0日目は0にする
 
# DPテーブル
dp = np.zeros([N+1, 3], dtype='int')
 
for i in range(1, N+1):  # 1日目からN日目までの幸福度を順番に計算する
    for j in range(3):  # i日目は海か山か家を選択する
        for k in range(3):  # i日目にjの活動をする場合、i-1日目はj以外の活動
            if k == j:
                continue
            dp[i][j] = max(dp[i][j], dp[i-1][k] + act[i][j])
            
print(np.max(dp[-1]))

Fixed submission:
N = int(input())
act = [list(map(int, input().split())) for _ in range(N)]

import numpy as np
act = np.array(act)
act = np.concatenate([[[0]*3], act])  # 0日目は0にする

# DPテーブル
dp = np.zeros([N+1, 3], dtype='int')

for i in range(1, N+1):  # 1日目からN日目までの幸福度を順番に計算する
    for j in range(3):  # i日目は海か山か家を選択する
        for k in range(3):  # i日目にjの活動をする場合、i-1日目はj以外の活動
            if k == j:
                continue
            dp[i][j] = max(dp[i][j], dp[i-1][k] + act[i][j])
            
print(np.max(dp[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
W, V = [0], [0]
for _ in range(n):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

dp = [[0]*(k+1) for _ in range(n+1)]

for i in range(1, n+1):
    for w in range(1, k+1):
        if w - W[i] >= 0:
            dp[i][w] = max(dp[i-1][w], dp[i-1][w-W[i]] + V[i])
        else:
            dp[i][w] = dp[i-1][w]
            
print(max(dp[-1]))

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

dp = [[0]*(k+1) for _ in range(n+1)]

for i in range(1, n+1):
    for w in range(1, k+1):
        if w - W[i] >= 0:
            dp[i][w] = max(dp[i-1][w], dp[i-1][w-W[i]] + V[i])
        else:
            dp[i][w] = dp[i-1][w]
            
print(max(dp[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0

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

if M%2 == 0:
    for i in range(M//N, 0, -1):
        if (M - i)%i == 0:
            break
    print(i)    
else:
    if M//N % 2 == 0:
        min_a = M//N - 1
    else:
        min_a = M//N
    for i in range(min_a, 0, -2):
        if (M - i)%i == 0:
            break
    print(i)      

Fixed submission:
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0

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

if M%2 == 0:
    for i in range(M//N, 0, -1):
        if (M - i)%i == 0:
            break
    print(i)    
else:
    if M//N % 2 == 0:
        min_a = M//N - 1
    else:
        min_a = M//N
    for i in range(min_a, 0, -2):
        if (M - i)%i == 0:
            break
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0

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

for i in range(M//N, 0, -1):
    if (M - i)%i == 0:
        break
print(i)

Fixed submission:
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0

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

if M%2 == 0:
    for i in range(M//N, 0, -1):
        if (M - i)%i == 0:
            break
    print(i)    
else:
    if M//N % 2 == 0:
        min_a = M//N - 1
    else:
        min_a = M//N
    for i in range(min_a, 0, -2):
        if (M - i)%i == 0:
            break
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0でありかつ、商がN-1以上

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

ans = 0
for i in range(1, M//N+1):
    r, q = divmod((M - i), i)
    if r >= N - 1 and q == 0:
        ans = max(ans, i)
print(ans)

Fixed submission:
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0

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

if M%2 == 0:
    for i in range(M//N, 0, -1):
        if (M - i)%i == 0:
            break
    print(i)    
else:
    if M//N % 2 == 0:
        min_a = M//N - 1
    else:
        min_a = M//N
    for i in range(min_a, 0, -2):
        if (M - i)%i == 0:
            break
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0でありかつ、商がN-1以上

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

for i in range(M//N, 0, -1):
    r, q = divmod((M - i), i)
    if r >= N - 1 and q == 0:
        break
print(i)

Fixed submission:
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0

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

if M%2 == 0:
    for i in range(M//N, 0, -1):
        if (M - i)%i == 0:
            break
    print(i)    
else:
    if M//N % 2 == 0:
        min_a = M//N - 1
    else:
        min_a = M//N
    for i in range(min_a, 0, -2):
        if (M - i)%i == 0:
            break
    print(i)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
for c in range(1, 4):
  if a*b*c%2 == 1:
    print('Yes')
	break
else:
  print('No')

Fixed submission:
a, b = map(int, input().split())
for c in range(1, 4):
    if a*b*c%2 == 1:
        print('Yes')
        break
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
S = input()
cnt = S[2:-1].count('C')

if s in S[1:]:
    if s.isupper() and s != 'C':
        print('WA')
        break
else:
    if S[0] == 'A' and cnt == 1:
        print('AC')
    else:
        print('WA')

Fixed submission:
S = input()
cnt = S[2:-1].count('C')
 
for s in S[1:]:
    if s.isupper() and s != 'C':
        print('WA')
        break
else:
    if S[0] == 'A' and cnt == 1:
        print('AC')
    else:
        print('WA')
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
x = list(range(a, b+1))
C = sorted(list(set(x[:k] + x[-k:])))
for c in C:
    print(c)

Fixed submission:
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
x = list(range(a, b+1))
C = list(set(x[:k] + x[-k:]))
C.sort()
for c in C:
    print(c)

Fixed submission:
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)
Buggy python submission (verdict: Runtime Error):
a, b, c = mapt(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):
a_num = int(input())
b_num = int(input())
c_num = int(input())
x = int(input())

tried = []
coins = []

def dfs(a, b, c):
  if (a, b, c) in tried:
    return None
  tried.append((a, b, c))
  total = a*500 + b*100 + c*50  
  if total > x or a > a_num or b > b_num or c > c_num:
    return None
  elif total == x:
    coins.append((a, b, c))
  else:
    dfs(a+1, b, c)
    dfs(a, b+1, c)
    dfs(a, b, c+1)
    
dfs(0, 0, 0)
print(len(coins))

Fixed submission:
a_num = int(input())
b_num = int(input())
c_num = int(input())
x = int(input())

total = []

for a in range(0, a_num+1):
  for b in range(0, b_num+1):
    for c in range(0, c_num+1):
      total.append(a*500+b*100+c*50)

print(total.count(x))
Buggy python submission (verdict: Runtime Error):
n = int(input())
time = []
point = []
for _ in range(n):
    time_point = list(map(int, input().split()))
    time.append(time_point[0])
    point.append(time_point[1:])

point_dict = dict(zip(time, point))
direction = [[1, 0], [-1, 0], [0, 1], [0, -1]]
moved = [[] for _ in range(time[-1] + 1)]

def dfs(t, x, y, dx, dy):
    nx = x + dx
    ny = y + dy
    if [nx, ny] in moved[t]:
        return 0
    moved[t].append([nx, ny])
    if [nx, ny] != point_dict.get(t, [nx, ny]):
        return 0
    if t == time[-1]:
        return 1
    else:
        return dfs(t+1, nx, ny, *direction[0]) + dfs(t+1, nx, ny, *direction[1]) + dfs(t+1, nx, ny, *direction[2]) + dfs(t+1, nx, ny, *direction[3])
        
for i in range(4):
    if dfs(1, 0, 0, *direction[i]) >= 1:
        print('Yes')
        break
else:
    print('No')

Fixed submission:
n = int(input())
t=x=y=0
ans = 'Yes'
for _ in range(n):
    nt, nx, ny = map(int, input().split())
    dis = abs(nx - x) + abs(ny - y)
    time = nt - t
    if dis <= time and dis%2 == time%2:
        t = nt
        x, y = nx, ny
        continue
    else:
        ans = 'No'
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
time = []
point = []
for _ in range(n):
    time_point = list(map(int, input().split()))
    time.append(time_point[0])
    point.append(time_point[1:])

direction = [[1, 0], [-1, 0], [0, 1], [0, -1]]
moved = [[] for _ in range(time[-1] + 1)]

def dfs(t, x, y, dx, dy):
    nx = x + dx
    ny = y + dy
    if [nx, ny] in moved[t]:
        return 0
    moved[t].append([nx, ny])
    if [nx, ny] != point_dict.get(t, [nx, ny]):
        return 0
    if t == time[-1]:
        return 1
    else:
        return dfs(t+1, nx, ny, *direction[0]) + dfs(t+1, nx, ny, *direction[1]) + dfs(t+1, nx, ny, *direction[2]) + dfs(t+1, nx, ny, *direction[3])
        
for i in range(4):
    if dfs(1, 0, 0, *direction[i]) >= 1:
        print('Yes')
        break
else:
    print('No')

Fixed submission:
n = int(input())
t=x=y=0
ans = 'Yes'
for _ in range(n):
    nt, nx, ny = map(int, input().split())
    dis = abs(nx - x) + abs(ny - y)
    time = nt - t
    if dis <= time and dis%2 == time%2:
        t = nt
        x, y = nx, ny
        continue
    else:
        ans = 'No'
print(ans)
Buggy python submission (verdict: Runtime Error):
nx = x*2
if nx > y:
    print(1)
else:
    i = 2
    while nx*2 <= y:
        nx = nx*2
        i += 1
    print(i)

Fixed submission:
x, y = map(int, input().split())

nx = x*2
if nx > y:
    print(1)
else:
    i = 2
    while nx*2 <= y:
        nx = nx*2
        i += 1
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

ans = 0
for i in range(n):
    a = A[i]
    for b in B[bisect.bisect_right(B, a):]:
        ans += len(C[bisect.bisect_right(C, b):])
print(ans)

Fixed submission:
import bisect, itertools

n = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

c_num = [0]*n
for i in range(n):
    c_num[i] = n - bisect.bisect_right(C, B[i])
c_accum = [0] + list(itertools.accumulate(c_num))

ans = 0
for i in range(n):
    b_index = bisect.bisect_right(B, A[i])
    ans += (c_accum[-1] - c_accum[b_index])
print(ans)
Buggy python submission (verdict: Runtime Error):
## import numpy as np
from collections import defaultdict

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

AB = []
G = defaultdict(list)
for _ in range(m):
    a, b = map(int, input().split())
    AB.append([a, b])
    G[a].append(b)
    G[b].append(a)

ans = 0
for a, b in AB:
    memo = [0]*(n+1)
    memo[a] = 1
    que = [c for c in G[a] if c != b]
    while que:
        c = que.pop()
        memo[c] = 1
        for nc in G[c]:
            if memo[nc] == 0:
                que.append(nc)
    if np.count_nonzero(memo) != n:
        ans += 1
print(ans)

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

from collections import defaultdict
d = defaultdict(list)
B = []
for _ in range(m):
    a1, a2 = list(map(int, input().split()))
    B.append([a1, a2])
    d[a1].append(a2)
    d[a2].append(a1)
    
def dfs(a, conn):
    memo[a] = 1
    for c in conn:
        if memo[c] == 0:
            dfs(c, d[c])
            
cnt = 0
for b in B:
    a1, a2 = b
    memo = [0]*(n+1)
    conn = set(d[a1]) - set([a2])
    dfs(a1, conn)
    if memo.count(1) != n:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

d = set([])
for _ in range(n):
    d = d ^ set([int(input())])
    
print(len(d))

Fixed submission:
n = int(input())

d = set()
for _ in range(n):
    d ^= {input()}
    
print(len(d))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))[::-1]
b = []
for _ in range(n):
    b.append(a.pop())
    b = b[::-1]
print(*b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if len(a)%2 == 1:
    print(*a[0::2][::-1] + a[1::2])
else:
    print(*a[1::2][::-1] + a[0::2])
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
for i in range(i, b+1):
  if a*i%b == c:
    print('YES')
    break
else:
  print('NO')

Fixed submission:
a, b, c = map(int, input().split())
for i in range(1, b+1):
  if a*i%b == c:
    print('YES')
    break
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
ans = 0
for a in range(k+1):
    if a > s:
        break
    for b in range(k+1):
        if a + b > s:
            break
        for c in range(k+1):
            if a + b + c == s:
                ans += 1
            elif a + b + c > s:
                break
print(ans)

Fixed submission:
k, s = map(int, input().split())
ans = 0
for a in range(k+1):
    for b in range(k+1):
        if 0 <= s - a - b <= k:
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
ans = 0
for a in range(k+1):
    for b in range(k+1):
        if a + b > s:
            break
        for c in range(k+1):
            if a + b + c == s:
                ans += 1
            elif a + b + c > s:
                break
print(ans)

Fixed submission:
k, s = map(int, input().split())
ans = 0
for a in range(k+1):
    for b in range(k+1):
        if 0 <= s - a - b <= k:
            ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
TA = [list(map(int, input().split())) for _ in range(n)]

PQ = [TA[0]]

for i in range(1, n):
    p0, q0 = PQ[i-1]
    p1, q1 = TA[i]
    t, a = TA[i]
    while p1 < p0 or q1 < q0:
        p1 += t
        q1 += a
    PQ.append([p1, q1])
    
print(sum(PQ[-1]))

Fixed submission:
n = int(input())
TA = [list(map(int, input().split())) for _ in range(n)]

XY = [TA[0]]

for i in range(1, n):
    x0, y0 = XY[i-1]
    x1, y1 = TA[i]
    xq, xr = divmod(x0, x1)
    yq, yr = divmod(y0, y1)
    if xr != 0:
        xq += 1
    if yr != 0:
        yq += 1
    q = max(xq, yq)
    x1, y1 = x1*q, y1*q
    XY.append([x1, y1])
    
print(sum(XY[-1]))
Buggy python submission (verdict: Runtime Error):
inputs = list(map(str, input()))

output = ''
for i in inputs:
	if output == 'B':
    	output = output[:-1]
	elif output == '1':
		output += '1'
    else:
      	output += '0'
print(output)

Fixed submission:
inputs = list(map(str, input()))
 
output = ''
for i in inputs:
    if i == 'B':
        output = output[:-1]
    elif i == '1':
        output += '1'
    else:
          output += '0'
print(output)
Buggy python submission (verdict: Runtime Error):
a = input()
if (a[2] == a[3]) and (a45] == a[5]):
    print("Yes")
else:
    print("No")

Fixed submission:
a = input()
if (a[2] == a[3]) and (a[4] == a[5]):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a = input()
if (a[3] == a[4]) and (a[5] == a[6]):
    print("Yes")
else:
    print("No")

Fixed submission:
a = input()
if (a[2] == a[3]) and (a[4] == a[5]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
d = {0: 1}
asum = 0
ans = 0
for a in map(int, input().split()):
    asum = (asum + a) % m
    if asum in d:
        ans += d[asum]
        d[asum] += 1
    else:
        d[asum] = 1
print(ans

Fixed submission:
n, m = map(int, input().split())
d = {0: 1}
asum = 0
ans = 0
for a in map(int, input().split()):
    asum = (asum + a) % m
    if asum in d:
        ans += d[asum]
        d[asum] += 1
    else:
        d[asum] = 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
c = list(map(int,input().split()))
cnt = 0
for i in range(a):
    j = i + 1
    while j < a+1:
        c[i:j]
        if sum(c[i:j])%b == 0:
            cnt += 1
        j += 1
print(cnt)

Fixed submission:
n, m = map(int, input().split())
d = {0: 1}
asum = 0
ans = 0
for a in map(int, input().split()):
    asum = (asum + a) % m
    if asum in d:
        ans += d[asum]
        d[asum] += 1
    else:
        d[asum] = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
b = int(input())
if a%500 < b:
    print('Yes')
else:
    print('No')

Fixed submission:
a = int(input())
b = int(input())
if a%500 <= b:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
f = 0
for i in range(a+1):
    if f == 1: break
    for j in range(a+1-i):
        if f == 1: break
        k = a+1-i-k
        if (i*10000 + j*5000 + k*1000) == b:
                f = 1
                print(i,j,k)
if f == 0: print(-1,-1,-1)

Fixed submission:
a,b = map(int,input().split())
f = 0
for i in range(a+1):
    if f == 1: break
    for j in range(a+1-i):
        if f == 1: break
        k = a-i-j
        if (i*10000 + j*5000 + k*1000) == b:
                f = 1
                print(i,j,k)
if f == 0: print(-1,-1,-1)
Buggy python submission (verdict: Runtime Error):
l = int(input())

from decimal import *
n = Decimal(l/3).quantize(Decimal('.001'))

print((l-2*n)*n*n)

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

print(int(n*(n-1)/2 + m*(m-1)/2))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

list = []
if 100*a%8:
  x=int(a/0.08)+1
else:
  x=int(a/0.08)

for i in range(x, int((a+1)/0.08)+1):
    if b/0.1 <= i <(b+1)/0.1:
        list.append(i)

        
list = sorted(list)
if list[0]:
    print(list[0])
else:
    print('-1')



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

list = []
if 100*a%8:
  x=int(a/0.08)+1
else:
  x=int(a/0.08)

if 100*(a+1)%8:
    y=int((a+1)/0.08)
else:
    y=int((a+1)/0.08)-1

    
for i in range(x, y+1):
    if b/0.1 <= i <(b+1)/0.1:
        list.append(i)

        
list = sorted(list)
if list:
    print(list[0])
else:
    print('-1')
Buggy python submission (verdict: Runtime Error):
h,n = map(int,input().split())
list1 = list(map(int,input().split()))

if h-sum(list1)<=0:
    print('Yes')
else:
    print('No')

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

ans =1
while h-a>0:
    h-=a
    ans+=1

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
listn = list(map(int,input().split()))

ans = 0
for i in range(1,n+1):
    list = sorted(listn[:i])
    if listn[i-1]==list[0]:
        ans+=1

print(ans)
    

Fixed submission:
n,m = map(int,input().split())
if n==m:
    print('Yes')
else:
    print('No')