Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
import queue
input = sys.stdin.readline

N, Q = map(int, input().split())
tree = [[] for _ in range(N+1)]
value = [0] * (N+1)
visit = [False] * (N+1)

# make_tree
for _ in range(N-1):
    a, b = map(int, input().split())
    tree[a].append(b)
    tree[b].append(a)

# make_value
for _ in range(Q):
    p, x = map(int, input().split())
    value[p] += x

# all_value_sum
q = queue.Queue()
q.put(1)
visit[1] = True
while not q.empty():
    now = q.get()
    for next in tree[now]:
        if not visit[next]:
            value[next] += value[now]
            q.put(next)
            visit[next] = True

# output_value
s = " ".join(map(str, value[1:]))
print(s)

Fixed submission:
a = int(input())
s = input()
print(s) if a >= 3200 else print("red")
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int ,input().split())
	print((a+0.5)//c * a)

Fixed submission:
a, b, c = map(int ,input().split())
print(int((c+0.5)//a * b))
Buggy python submission (verdict: Runtime Error):
#全探索
def jump_all(cs):
    if cs == N:
        return 0
    elif cs == N - 1:
        return jump_all(cs + 1) + (h[cs+1] - h[cs])
    else:
        SINGLE = jump_all(cs + 1) + abs(h[cs+1] - h[cs])
        DOUBLE = jump_all(cs + 2) + abs(h[cs+2] - h[cs])
        return min(SINGLE, DOUBLE)


N = int(input())
h = list(map(int, input().split()))
h.append(h[-1])
ans = jump_all(0)
print(ans)


Fixed submission:
# DP
def frog_dp():
    cost = [0] * N
    for cs in range(1, N):
        if cs == 1:
            cost[cs] = abs(h[cs]-h[cs-1])
        else:
            cost[cs] = min(cost[cs-1] + abs(h[cs]-h[cs-1]), cost[cs-2] + abs(h[cs] - h[cs-2]))
    return cost[-1]


N = int(input())
h = list(map(int, input().split()))
ans = frog_dp()
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
count = 0
for cake in range(0,n+1,4):
    for donatsu in range(0,n+1,7):
        count += 1
print("Yes") if count >= 1 else print("No")
n = int(input())
count = 0
for cake in range(0,n+1,4):
    for donatsu in range(0,n+1,7):
        if donatsu + cake == 0:
            count += 1
print("Yes") if count >= 1 else print("No")


Fixed submission:
n = int(input())
count = 0
for cake in range(0,n+1,4):
    for donatsu in range(0,n+1,7):
        if donatsu + cake == n:
            count += 1
print("Yes") if count >= 1 else print("No")
Buggy python submission (verdict: Runtime Error):
/Users/isiidaisuke/PycharmProjects/program/venv/bin/python /Users/isiidaisuke/PycharmProjects/program/program.py
89
Yes

Process finished with exit code 0


Fixed submission:
a = input()
print("Yes") if "9" in a else print("No")
Buggy python submission (verdict: Runtime Error):
num = "".join(input().split())
print("YES") if num%4 == 0 else print("NO")

Fixed submission:
num = "".join(input().split())
print("YES") if int(num) % 4 == 0 else print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
count = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z == s:
                count += 1
print(count)


Fixed submission:
k, s = map(int, input().split())
count = 0
for x in range(k+1):
    for y in range(k+1):
        if s-(x+y) >= 0 and s-(x+y) <= k:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().split())
S = [input() for _ in range(3)]
S.sort()
print("".join(S))

Fixed submission:
n, l = map(int, input().split())
S = [input() for _ in range(n)]
S.sort()
print("".join(S))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

print(0 if n == 1 else sum([(i - 1)%i for i in range(2, n + 1)]))

Fixed submission:
n = int(input())
print((n - 1)*n//2)
Buggy python submission (verdict: Time Limit Exceeded):
import math

def comb(n, r):
    if n < 2:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())

string = []
count = 0

for i in range(n):
    string.append("".join(sorted(input())))

base = len(string)
string_set = list(set(string))

if base == len(string_set):
    print(0)
else:
    total = 0
    for ref in string_set:
        total += (comb(string.count(ref), 2))
    print(total)


Fixed submission:
n = int(input())
 
string = {}
count = 0

for i in range(n):
    base = sorted(input())

    if string.get("".join(base)) != None:
        count += int(string["".join(base)])
        string["".join(base)] += 1
    else:
        string["".join(base)] = 1

print(count)

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

string = []
count = 0

for i in range(n):
    string.append(sorted(input()))

for i in range(n):
    for j in range(i+1, n):
        if string[i] == string[j]:
            count += 1

print(count)

Fixed submission:
n = int(input())
 
string = {}
count = 0

for i in range(n):
    base = sorted(input())

    if string.get("".join(base)) != None:
        count += int(string["".join(base)])
        string["".join(base)] += 1
    else:
        string["".join(base)] = 1

print(count)

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

count = 0
table = [[0 for i in range(26)] for _ in range(n)]

for i in range(n):
    for s in str(input()):
        table[i][ord(s)-97] += 1

for i in range(n):
    for j in range(i+1, n):
        if table[i] == table[j]:
            count += 1

print(count)

Fixed submission:
n = int(input())
 
string = {}
count = 0

for i in range(n):
    base = sorted(input())

    if string.get("".join(base)) != None:
        count += int(string["".join(base)])
        string["".join(base)] += 1
    else:
        string["".join(base)] = 1

print(count)

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

string = []
count = 0
# a-z : 0-25
# print(ord('a')-97, ord('z')-97)

table = [[0 for i in range(26)] for _ in range(n)]

for i in range(n):
    for s in str(input()):
        table[i][ord(s)-97] += 1

for i in range(n):
    for j in range(i, n):
        if (i != j) and (table[i] == table[j]):
            count += 1
            
print(count)

Fixed submission:
n = int(input())
 
string = {}
count = 0

for i in range(n):
    base = sorted(input())

    if string.get("".join(base)) != None:
        count += int(string["".join(base)])
        string["".join(base)] += 1
    else:
        string["".join(base)] = 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = [int(input()) for _ in range(n)]

for i in range(n):
    tmp = a[i]
    a[i] = 0
    print(max(a))
    a[i] = tmp

Fixed submission:
n = int(input())

a = [int(input()) for _ in range(n)]
b = sorted(a)
m1 = b[-1]
m2 = b[-2]

for i in range(n):
    if a[i] == m1:
        print(m2)
    else:
        print(m1)
Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())
 
v = []

if l == 0:
    print(0)
if l*r < 2019:
    print(l*r)
else:
    for a, i in enumerate(range(l, r+1)):
        for j in range(i+1, r+1):
            if i*j%2019 in v:
                break
            else:
                v.append(i*j%2019)
        else:
            continue
        break

    print(min(v))

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

print(min(n*a, b))

Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())
 
v = []
 
if l*r < 2019:
    print(l*r)
else:
    flag = True
    for a, i in enumerate(range(l, r+1)):
        for j in range(l+a+1, r+1):
            if i*j%2019 in v:
                break
            else:
                v.append(i*j%2019)
        else:
            continue
        break

    print(min(v))

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

print(min(n*a, b))

Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())
 
v = []
 
if l*r < 2019:
    print(l*r)
else:
    for a, i in enumerate(range(l, r+1)):
        for j in range(l+a+1, r+1):
            if i*j%2019 in v:
                print(min(v))
                exit()
            else:
                v.append(i*j%2019)
                
    print(min(v))

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

print(min(n*a, b))
Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())
 
v = []

if l*r < 2019:
    print(l*r)
else:
    c = r - l
    for i in range(l, l + c):
        for j in range(i+1, l + c):
            v.append(i*j%2019)
            if v[-1] == 0:
                break
        else:
            continue
        break

    print(min(v))

Fixed submission:
l, r = map(int, input().split())
 
v = []
if l*r < 2019:
    print(l*r)
else:
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            v.append(i*j%2019)
            if v[-1] == 0:
                break
        else:
            continue
        break
 
    print(min(v))
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int,input().split())
a = [K]*N

for i in range(Q):
    a=list(map(lambda x: x-1, a))
    a[int(input())-1]+=1
for i in range(N):
    if a[i]>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K,Q = map(int,input().split())
a = [K]*N

for i in range(Q):
    a[int(input())-1]+=1
a=list(map(lambda x: x-Q, a))
for i in range(N):
    if a[i]>0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int,input().split())
a = [K]*N
for i in range(Q):
    a=[i-1 for i in a]
    a[int(input())-1]+=1
for i in range(N):
    if a[i]>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K,Q = map(int,input().split())
a = [K]*N

for i in range(Q):
    a[int(input())-1]+=1
a=list(map(lambda x: x-Q, a))
for i in range(N):
    if a[i]>0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
a = list(map(int,input().split()))

for i in range(M):
    x = max(a)
    a[a.index(x)]=x//2
print(sum(a))

Fixed submission:
import heapq
N,M = map(int,input().split())
a = [-i for i in list(map(int,input().split()))]
heapq.heapify(a)
for i in range(M):
    m = heapq.heappop(a)
    heapq.heappush(a,-(-m//2))
print(-sum(a))

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

for i in range(M):
    a[a.index(max(a))]=max(a)//2
print(sum(a))

Fixed submission:
import heapq
N,M = map(int,input().split())
a = [-i for i in list(map(int,input().split()))]
heapq.heapify(a)
for i in range(M):
    m = heapq.heappop(a)
    heapq.heappush(a,-(-m//2))
print(-sum(a))
Buggy python submission (verdict: Runtime Error):
import numpy as np
H,W = map(int,input().split())
h = [0]*H
w = [0]*W
l = [list(input()) for i in range(H)]
for i in range(H):
    if all([i=='.' for i in l[i][:]]):
        h[i]=1
for j in range(W):
    if all([j=='.' for j in np.array(l).T[j][:]]):
        w[j]=1
for i in range(H):
    for j in range(W):
        if h[i]==0 and w[j]==0:
            print(l[i][j],end='')
    if h[i]==0:
        print()

Fixed submission:
H,W = map(int,input().split())
h = [0]*H
w = [0]*W
l = [list(input()) for i in range(H)]
for i in range(H):
    if all([i=='.' for i in l[i][:]]):
        h[i]=1
lt = list(zip(*l))
for j in range(W):
    if all([j=='.' for j in lt[j][:]]):
        w[j]=1
for i in range(H):
    for j in range(W):
        if h[i]==0 and w[j]==0:
            print(l[i][j],end='')
    if h[i]==0:
        print()
Buggy python submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
MAX = math.gcd(A, B)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
print(len(set(prime_factorize(MAX)))+1)

Fixed submission:
import fractions
A, B = map(int, input().split())
MAX = fractions.gcd(A, B)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
print(len(set(prime_factorize(MAX)))+1)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K]*N
for i in range(1, Q+1):
    ans = list(map(lambda x: x-1, ans))
    ans[A[i-1]-1] += 1    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K-Q]*N
for i in range(1,Q+1):
    ans[A[i-1]-1] += 1    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K]*N
def minus(n):
    return n-1
for i in range(1, Q+1):
    ans = list(map(minus, ans))
    ans[A[i-1]-1] += 1    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K-Q]*N
for i in range(1,Q+1):
    ans[A[i-1]-1] += 1    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K]*N
def minus(n):
    return n-1
for i in range(1, Q+1):
    ans = list(map(minus, ans))
    ans[A[i-1]-1] += 1    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K-Q]*N
for i in range(1,Q+1):
    ans[A[i-1]-1] += 1    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = np.array([K]*N)
minus = np.array([-1]*N)
for i in range(1, Q+1): # round
    minus[A[i-1]-1] = 0
    ans += minus
    minus = np.array([-1]*N)    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K-Q]*N
for i in range(1,Q+1):
    ans[A[i-1]-1] += 1    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K]*N
for i in range(1, Q+1): # round
    for j in range(1, N+1):
        if A[i-1] != j:
            ans[j-1] -= 1
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')

Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K-Q]*N
for i in range(1,Q+1):
    ans[A[i-1]-1] += 1    
for k in ans:
    if k <= 0:
        print('No')
    else:
         print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [i for i in range(1, N+1)]
print(sum(L)-max(L))    

Fixed submission:
N = int(input())
if N % 2 == 0:
    print(N*(N//2)-N//2)
else:
    print(N*(N//2))
Buggy python submission (verdict: Runtime Error):
import sys
args = sys.argv
a = int(args[1])
b = int(args[2])
c = int(args[3])

def restWater():
    restWater = c - (a - b)
    if restWater >= 0:
        print(restWater)
    else:
        print(0)

restWater()

Fixed submission:
s = list(map(int, input().split()))
a = s[0]
b = s[1]
c = s[2]

def restWater():
    restWater = c - (a - b)
    if restWater >= 0:
        print(restWater)
    else:
        print(0)

restWater()
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
cnt = 0
for n in range(N):
    if p[n] != n+1:
        cnt+=1

if cnt <= 2:
    print("YES")
else:
    print("NO")

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

Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
q = p.copy()
cnt = 0
for n in range(N):
    if p[n] != q[n]:
        cnt+=1

if cnt <= 2:
    print("YES")
else:
    print("NO")

Fixed submission:
a, b = map(int, input().split())
if (a + b) % 2 != 0:
    print("IMPOSSIBLE")
else:
    print(int((a+b)/2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
cnt = 0
for n in range(N):
    if p[n] != i+1:
        cnt+=1

if cnt <= 2:
    print("YES")
else:
    print("NO")

Fixed submission:
N = int(input())
p = list(map(int, input().split()))
cnt = 0
for n in range(N):
    if p[n] != n+1:
        cnt+=1
 
if cnt <= 2:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
cnt = 0
for n in range(N):
    if p[n] != i+1:
        cnt+=1

if cnt <= 2:
    print("YES")
else:
    print("NO")

Fixed submission:
N = int(input())
p = list(map(int, input().split()))
cnt = 0
for n in range(N):
    if p[n] != n+1:
        cnt+=1
 
if cnt <= 2:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
i = 0
j = 0
for n in range(N-1):
    if p[n] > p[n+1]:
        if i == 0:
            i = p[n]
        elif j == 0:
            j = p[n+1]
        else:
            print("NO")
            exit()

if i == 0 and j == 0:
    print("YES")
elif j < p[p.index(i)+1] and p[p.index(j)-1] < i:
    print("YES") 
else:
    print("NO")

Fixed submission:
N = int(input())
p = list(map(int, input().split()))
cnt = 0
for n in range(N):
    if p[n] != n+1:
        cnt+=1
 
if cnt <= 2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for _ in range(N):
    A.append(input())

B = A.copy()
B.remove(max(A))
second_max = max(B)
for i in range(N):
    if A[i] == max(A):
        print(second_max)
    else:
        print(max(A))

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]

B = sorted(A)
A_max, A_second_max = B[-1], B[-2] 
for i in A:
    if i == A_max:
        print(A_second_max)
    else:
        print(A_max)
Buggy python submission (verdict: Runtime Error):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(Y)
if max(x) < min(y):
    print('No War')
else:
    print('War')

Fixed submission:
A, B, C = map(int, input().split())
if max(A, B, C) == A:
    print(10*A + B + C)
elif max(A, B, C) == B:
    print(10*B + A + C)
else:
    print(10*C + B + A)
Buggy python submission (verdict: Runtime Error):
print(A*B-A-B+1)


Fixed submission:
A, B = map(int, input().split())
print(A*B-A-B+1)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
L = []
if A+K+1 >= B-K+1:
    for i in range(A, b+1):
        print(i)
        exit()
for i in range(A, A+K):
    L.append(i)
for j in range(B-K+1, B+1):
    L.append(j)
list(set(L)).sort()
for k in L:
    print(k)

Fixed submission:
A, B, K = map(int, input().split())
for i in range(A, min(A+K, B+1)):
    print(i)
for i in range(max(B-K+1, A+K), B+1):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())
for i in range(A, B+1):
    if i < A+K or B-K < i:
        print(i)

Fixed submission:
A, B, K = map(int, input().split())
for i in range(A, min(A+K, B+1)):
    print(i)
for i in range(max(B-K+1, A+K), B+1):
    print(i)
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
yukichi = -1
ichiyo = -1
hideyo = -1
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        total = 10000*a + 5000*b + 1000*c
        if total == Y:
            yukichi = a
            ichiyo = b
            hideyo = c

print(f'{yukichi} {ichiyo} {hideyo}')

Fixed submission:
N, Y = map(int, input().split())
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        total = 10000*a + 5000*b + 1000*c
        if total == Y:
            print(a, b, c)
            exit()
print('-1 -1 -1')

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
yukichi = -1
ichiyo = -1
hideyo = -1
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        total = 10000*a + 5000*b + 1000*c
        if total == Y and c >= 0:
            yukichi = a
            ichiyo = b
            hideyo = c

print(f'{yukichi} {ichiyo} {hideyo}')

Fixed submission:
N, Y = map(int, input().split())
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        total = 10000*a + 5000*b + 1000*c
        if total == Y:
            print(a, b, c)
            exit()
print('-1 -1 -1')

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
yukichi = -1
ichiyo = -1
hideyo = -1
for a in range(N+1):
    for b in range(N+1):
        c = N - a - b
        total = 10000*a + 5000*b + 1000*c
        if total == Y and c >= 0:
            yukichi = a
            ichiyo = b
            hideyo = c

print(f'{yukichi} {ichiyo} {hideyo}')

Fixed submission:
N, Y = map(int, input().split())
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        total = 10000*a + 5000*b + 1000*c
        if total == Y:
            print(a, b, c)
            exit()
print('-1 -1 -1')

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
yukichi = -1
ichiyo = -1
hideyo = -1
for a in range(N+1):
    for b in range(N+1):
        c = N - a - b
        total = 10000*a + 5000*b + 1000*c
        if total == Y and c >= 0:
            yukichi = a
            ichiyo = b
            hideyo = c

print(f'{yukichi} {ichiyo} {hideyo}')

Fixed submission:
N, Y = map(int, input().split())
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        total = 10000*a + 5000*b + 1000*c
        if total == Y:
            print(a, b, c)
            exit()
print('-1 -1 -1')
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
for i in range(N-M+1):
    for j in range(N-M+1):
        cnt = 0
        for k in range(i,i+M): # yoko
            for l in range(j,j+M): # tate
                if A[k][l]!=B[k][l]:
                    break
                else:
                    cnt+=1
        if cnt == M*M:
            print('Yes')
            exit()             
print('No')

Fixed submission:
N, M = map(int, input().split())
A = [list(input()) for _ in range(N)]
B = [list(input()) for _ in range(M)]
for i in range(N-M+1):
    for j in range(N-M+1):
        flg = True
        for k in range(M):
            for l in range(M):
                if A[i+k][j+l]!=B[k][l]:
                    flg = False    
        if flg == True:
            print('Yes')
            exit()             
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x + y + z == S:
                count += 1
print(count)

Fixed submission:
K, S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= S-x-y <= K:
            count += 1
print(count)