Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A_list = []
for i in range(5):
    A_list.append(input())
one_list = []
one_list.append(int(A_list[0][-1]))
one_list.append(int(A_list[1][-1]))
one_list.append(int(A_list[2][-1]))
one_list.append(int(A_list[3][-1]))
one_list.append(int(A_list[4][-1]))
min_num = max(one_list)
for i in range(len(one_list)):
    if one_list[i] != 0 and min_num >= one_list[i]:
        min_num = one_list[i]
        min_one_list_index = i
A_list_min = A_list[min_one_list_index]
del A_list[min_one_list_index]


def ceil(src, range):
    if src % 10 == 0:
        return src
    else:
        return ((int)(src / range) + 1 ) * range


for i in range(len(A_list)):
    A_list[i] = ceil(int(A_list[i]), 10)
print(sum(A_list)+int(A_list_min))

Fixed submission:
A_list = []
for i in range(5):
    A_list.append(input())
one_list = []
one_list.append(int(A_list[0][-1]))
one_list.append(int(A_list[1][-1]))
one_list.append(int(A_list[2][-1]))
one_list.append(int(A_list[3][-1]))
one_list.append(int(A_list[4][-1]))
min_num = max(one_list)
min_one_list_index = 1
for i in range(len(one_list)):
    if one_list[i] != 0 and min_num >= one_list[i]:
        min_num = one_list[i]
        min_one_list_index = i
A_list_min = A_list[min_one_list_index]
del A_list[min_one_list_index]


def ceil(src, range):
    if src % 10 == 0:
        return src
    else:
        return ((int)(src / range) + 1 ) * range


for i in range(len(A_list)):
    A_list[i] = ceil(int(A_list[i]), 10)
print(sum(A_list)+int(A_list_min))

Buggy python submission (verdict: Runtime Error):
A_list = []
for i in range(5):
    A_list.append(input())
one_list = []
one_list.append(int(A_list[0][-1]))
one_list.append(int(A_list[1][-1]))
one_list.append(int(A_list[2][-1]))
one_list.append(int(A_list[3][-1]))
one_list.append(int(A_list[4][-1]))
min_num = max(one_list)
for i in range(len(one_list)):
    if one_list[i] != 0 and min_num >= one_list[i]:
        min_num = one_list[i]
        min_one_list_index = i
A_list_min = A_list[min_one_list_index]
del A_list[min_one_list_index]


def ceil(src, range):
    return ((int)(src / range) + 1 ) * range


for i in range(len(A_list)):
    A_list[i] = ceil(int(A_list[i]), 10)
print(sum(A_list)+int(A_list_min))

Fixed submission:
A_list = []
for i in range(5):
    A_list.append(input())
one_list = []
one_list.append(int(A_list[0][-1]))
one_list.append(int(A_list[1][-1]))
one_list.append(int(A_list[2][-1]))
one_list.append(int(A_list[3][-1]))
one_list.append(int(A_list[4][-1]))
min_num = max(one_list)
min_one_list_index = 1
for i in range(len(one_list)):
    if one_list[i] != 0 and min_num >= one_list[i]:
        min_num = one_list[i]
        min_one_list_index = i
A_list_min = A_list[min_one_list_index]
del A_list[min_one_list_index]


def ceil(src, range):
    if src % 10 == 0:
        return src
    else:
        return ((int)(src / range) + 1 ) * range


for i in range(len(A_list)):
    A_list[i] = ceil(int(A_list[i]), 10)
print(sum(A_list)+int(A_list_min))
Buggy python submission (verdict: Runtime Error):
b = int(input())
if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "C":
    print("G")
else:
    print("C")

Fixed submission:
b = input()
if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "C":
    print("G")
else:
    print("C")
Buggy python submission (verdict: Runtime Error):
S = input()
list_atgc = ["A", "C", "G", "T"]
demand_list = []
for i in range(len(S)):
    if S[i] in list_atgc:
        for j in range(i, len(S)-i):
            if S[j] in list_atgc:
                demand_list.append(S[i:j+1])
print(len(max(demand_list, key=len)))

Fixed submission:
S = input()
list_atgc = ["A", "C", "G", "T"]
demand_list = []
for i in range(len(S)):
    if S[i] in list_atgc:
        j = 0
        string_k = ""
        while True:
            if S[i+j] in list_atgc:
                string_k += S[i+j]
                demand_list.append(string_k)
                j += 1
                if i + j >= len(S):
                    break
            else:
                break
if demand_list:
    print(len(max(demand_list, key=len)))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
S = input()
list_atgc = ["A", "C", "G", "T"]
demand_list = []
for i in range(len(S)):
    if S[i] in list_atgc:
        for j in range(i, len(S)-i):
            if S[j] in list_atgc:
                demand_list.append(S[i:j+1])
print(max(demand_list, key=len))

Fixed submission:
S = input()
list_atgc = ["A", "C", "G", "T"]
demand_list = []
for i in range(len(S)):
    if S[i] in list_atgc:
        j = 0
        string_k = ""
        while True:
            if S[i+j] in list_atgc:
                string_k += S[i+j]
                demand_list.append(string_k)
                j += 1
                if i + j >= len(S):
                    break
            else:
                break
if demand_list:
    print(len(max(demand_list, key=len)))
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
l = 0
r = 0
for i in range(Q):
    l, r = map(int, input().split())
    print(S[l-1: r].count("AC"))

Fixed submission:
n,q=map(int,input().split())
s=input()
a=[0]*n
for i in range(n):
    if i:
        a[i]=a[i-1]+(s[i-1:i+1]=='AC')
for _ in range(q):
    l,r=map(int,input().split())
    print(a[r-1]-a[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
l_r = []
for i in range(Q):
    l_r.append(list(map(int, input().split())))
    print(S[l_r[i][0]-1: l_r[i][1]].count("AC"))

Fixed submission:
n,q=map(int,input().split())
s=input()
a=[0]*n
for i in range(n):
    if i:
        a[i]=a[i-1]+(s[i-1:i+1]=='AC')
for _ in range(q):
    l,r=map(int,input().split())
    print(a[r-1]-a[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
l_r = []
for i in range(Q):
    l_r.append(list(map(int, input().split())))
demand_count = []
for i in range(len(l_r)):
    print(S[l_r[i][0]-1: l_r[i][1]].count("AC"))

Fixed submission:
n,q=map(int,input().split())
s=input()
a=[0]*n
for i in range(n):
    if i:
        a[i]=a[i-1]+(s[i-1:i+1]=='AC')
for _ in range(q):
    l,r=map(int,input().split())
    print(a[r-1]-a[l-1])
Buggy python submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
a = []
correct_num = 0
for i in range(N):
    a.append(map(int, input().split()))
    sum = 0
    for j in range(M):
        sum + =a[i][j] * B[j]
    if sum > 0:
        correct_num += 1
    else:
        pass
print(sum)

Fixed submission:
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
a = []
correct_num = 0
for i in range(N):
    a.append(list(map(int, input().split())))
    sum = 0
    for j in range(M):
        sum += a[i][j] * B[j]
    if sum + C > 0:
        correct_num += 1
    else:
        pass
print(correct_num)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A_B = []
for i in range(N):
    A_B.append(list(map(int, input().split())))
A_B.sort()
sum = 0
money = 0
i = 0
while sum <= M:
    money += A_B[i][0] * A_B[i][1]
    sum += A_B[i][1]
    i += 1
money -= A_B[i-1][0] * (sum - M)
print(money)

Fixed submission:
N, M = map(int, input().split())
A_B = []
for i in range(N):
    A_B.append(list(map(int, input().split())))
A_B.sort()
sum = 0
money = 0
i = 0
while sum <= M and i < N:
    money += A_B[i][0] * A_B[i][1]
    sum += A_B[i][1]
    i += 1
money -= A_B[i-1][0] * (sum - M)
print(money)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A_B = []
for i in range(N):
    A_B.append(list(map(int, input().split())))
A_B.sort()
print(A_B)
sum = 0
money = 0
i = 0
while sum <= M:
    money += A_B[i][0] * A_B[i][1]
    sum += A_B[i][1]
    print(sum)
    i += 1
money -= A_B[i-1][0] * (sum - M)
print(money)


Fixed submission:
N, M = map(int, input().split())
A_B = []
for i in range(N):
    A_B.append(list(map(int, input().split())))
A_B.sort()
sum = 0
money = 0
i = 0
while sum <= M and i < N:
    money += A_B[i][0] * A_B[i][1]
    sum += A_B[i][1]
    i += 1
money -= A_B[i-1][0] * (sum - M)
print(money)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
for i in range(N):
    A.append(list(map(int , input().split())))
A = sorted(A)
min_money = 0
if A[0][1] >= M:
    min_money = A[0][0] * M
else:
    i = 0
    num_of_buy = A[0][1]
    min_money = A[0][0] * A[0][1]
    while True:
        if num_of_buy + A[i+1][1] > M:
            min_money += A[i+1][0] * (M - num_of_buy)
            break
        else:
            min_money += A[i+1][0] * A[i+1][1]
            num_of_buy += A[i+1][1]
            i += 1
print(min_money)

Fixed submission:
N, M = map(int, input().split())
A_B = []
for i in range(N):
    A_B.append(list(map(int, input().split())))
A_B.sort()
sum = 0
money = 0
i = 0
while sum <= M and i < N:
    money += A_B[i][0] * A_B[i][1]
    sum += A_B[i][1]
    i += 1
money -= A_B[i-1][0] * (sum - M)
print(money)
Buggy python submission (verdict: Runtime Error):
N = len(S)
num_one = S.count('1')
num_zero = S.count('0')
print(N - abs(num_one - num_zero))

Fixed submission:
S = list(map(str, input().strip()))
num_of_zero = S.count('0')
num_of_one = S.count('1')
if num_of_zero <=  num_of_one:
    delete_num = 2 * num_of_zero
else:
    delete_num = 2 * num_of_one
print(delete_num)
Buggy python submission (verdict: Runtime Error):
import math


N = int(input())
A = list(map(int, input().split()))
first_gcd = A[0]
for i in range(len(A)):
    first_gcd = math.gcd(first_gcd, A[i])
print(first_gcd)

Fixed submission:
def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x


N = int(input())
A = list(map(int, input().split()))
first_gcd = A[0]
for i in range(len(A)):
    first_gcd = gcd(first_gcd, A[i])
print(first_gcd)

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


N = int(input())
A = list(map(int, input().split()))
A.sort()
A_min = min(A)
del A[0]
A_min_2 = min(A)
print(math.gcd(A_min, A_min_2))

Fixed submission:
def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x


N = int(input())
A = list(map(int, input().split()))
first_gcd = A[0]
for i in range(len(A)):
    first_gcd = gcd(first_gcd, A[i])
print(first_gcd)

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


N = int(input())
A = list(map(int, input().split()))
A.sort()
A_min = min(A)
del A[0]
A_min_2 = min(A)
print(math.gcd(A_min, A_min_2))

Fixed submission:
def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x


N = int(input())
A = list(map(int, input().split()))
first_gcd = A[0]
for i in range(len(A)):
    first_gcd = gcd(first_gcd, A[i])
print(first_gcd)
Buggy python submission (verdict: Runtime Error):
X = list(map(int, input().split()))
X.sort()
if N >= M:
    print(0)
else:
    L = []
    for i in range(M-1):
        L.append(X[i+1] - X[i])
    L.sort()
    for i in range(N-1):
        del L[-1]
    print(sum(L))

Fixed submission:
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >=  M:
    print(0)
else:
    X.sort()
    X_sub = []
    for i in range(len(X)-1):
        X_sub.append(X[i+1]-X[i])
    X_sub.sort()
    for i in range(N-1):
        del X_sub[-1]
    print(sum(X_sub))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
X_sub = []
for i in range(len(X)-1):
    X_sub.append(X[i+1]-X[i])
X_sub.sort()
for i in range(N-1):
    del X_sub[-1]
print(sum(X_sub))

Fixed submission:
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >=  M:
    print(0)
else:
    X.sort()
    X_sub = []
    for i in range(len(X)-1):
        X_sub.append(X[i+1]-X[i])
    X_sub.sort()
    for i in range(N-1):
        del X_sub[-1]
    print(sum(X_sub))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
X_sub = []
for i in range(len(X)-1):
    X_sub.append(X[i+1]-X[i])
X_sub.sort()
for i in range(N-1):
    del X_sub[-1]
print(X_sub)
print(sum(X_sub))

Fixed submission:
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >=  M:
    print(0)
else:
    X.sort()
    X_sub = []
    for i in range(len(X)-1):
        X_sub.append(X[i+1]-X[i])
    X_sub.sort()
    for i in range(N-1):
        del X_sub[-1]
    print(sum(X_sub))
Buggy python submission (verdict: Runtime Error):
s = int(input())
s_list = []
if s != 1 or s != 2:
    while s != 1:
        if s % 2 == 0:
            s = s / 2
        else:
            s = 3 * s + 1
        s_list.append(s)
    print(max(len(s_list)+2), 4)
else:
    print(4)

Fixed submission:
s = int(input())
s_list = []
if s != 1 or s != 2:
    while s != 1:
        if s % 2 == 0:
            s = s / 2
        else:
            s = 3 * s + 1
        s_list.append(s)
    print(max(len(s_list)+2, 4))
else:
    print(4)
Buggy python submission (verdict: Runtime Error):
s = input()
if s[:7] == 'keyence':
    print('YES')
    exit()
if s[-7:] == 'keyence':
    print('YES')
    exit()
for i in range(n):
    if s[:i] + s[-(7-i):] == 'keyence':
        print('YES')
        exit()
print('NO')

Fixed submission:
s = input()
if s[:7] == 'keyence':
    print('YES')
    exit()
if s[-7:] == 'keyence':
    print('YES')
    exit()
for i in range(len(s)):
    if s[:i] + s[-(7-i):] == 'keyence':
        print('YES')
        exit()
print('NO')

Buggy python submission (verdict: Runtime Error):
s = input()
if s[:7] === 'keyence':
    print('YES')
    exit()
if s[-7:] === 'keyence':
    print('YES')
    exit()
for i in range(n):
    if s[:i] + s[-(7-i):] == 'keyence':
        print('YES')
        exit()
print('NO')

Fixed submission:
s = input()
if s[:7] == 'keyence':
    print('YES')
    exit()
if s[-7:] == 'keyence':
    print('YES')
    exit()
for i in range(len(s)):
    if s[:i] + s[-(7-i):] == 'keyence':
        print('YES')
        exit()
print('NO')
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [0]*N
for i in range(N):
    h[i] = int(input())
h.sort()
print(min(h[i+K+1] - h[i] for i in range(N-K+1)))

Fixed submission:
N, K = map(int, input().split())
h = [0] * N
for i in range(N):
    h[i] = int(input())
h.sort()
print(min(h[i+K-1]-h[i] for i in range(N-K+1)))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [0] * N
for i in range(N):
    h[i] = int(input())
h.sort()
print(min(h[i+K-1]-h[i] for i in range(N)))


Fixed submission:
N, K = map(int, input().split())
h = [0] * N
for i in range(N):
    h[i] = int(input())
h.sort()
print(min(h[i+K-1]-h[i] for i in range(N-K+1)))
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
a, p = [1], [1]
for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)


def f(N, X):
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X - 2 - a[N-1])


print(f(N, X))


Fixed submission:
n, x = map(int, input().split())
a, p = [1], [1]
for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)


def f(N, X):
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X - 2 - a[N-1])


print(f(N=n, X=x))
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==111:
    print(999)
if n==119:
    prit(991)
if n==191:
    print(919)
if n==199:
    print(911)
if n==911:
    print(199)
if n==919:
    print(191)
if n==991:
    print(119)
if n==999:
    print(111)


Fixed submission:
n=int(input())
if n==111:
    print(999)
elif n==119:
    print(991)
elif n==191:
    print(919)
elif n==199:
    print(911)
elif n==911:
    print(199)
elif n==919:
    print(191)
elif n==991:
    print(119)
elif n==999:
    print(111)
Buggy python submission (verdict: Runtime Error):
n=int(input())
count=0
v=[]
v=[int(i) for i in input().split()]
for i in range(n-2):
    if v[i]==v[i+2]:
        pass
    else:
        count+=1
num=v[0]
for i in range(n):
    v.remove(num)
print(v)
if len(v)==0:
    if n%2==0:
        count=int(n/2)
    else:
        count=int((n-1)/2)
print(count)


Fixed submission:
import itertools
from collections import Counter


n = int(input())
v = list(map(int, input().split()))
ev_cnt = Counter(v[::2])
od_cnt = Counter(v[1::2])
ev_cnt[-1] = 0
od_cnt[-2] = 0
ev = ev_cnt.most_common(2)
od = od_cnt.most_common(2)
ans = n
for (k1, v1), (k2, v2) in itertools.product(ev, od):
    if k1 == k2:
        continue
    x = (n - v1 - v2)
    ans = min(ans, x)
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
count=0
v=[]
v=[int(i) for i in input().split()]
for i in range(n-2):
    if v[i]==v[i+2]:
        pass
    else:
        count+=1
v.pop(v[0])
if len(v)==0:
    if n%2==0:
        count=int(n/2)
    else:
        count=int((n-1)/2)
print(count)


Fixed submission:
import itertools
from collections import Counter


n = int(input())
v = list(map(int, input().split()))
ev_cnt = Counter(v[::2])
od_cnt = Counter(v[1::2])
ev_cnt[-1] = 0
od_cnt[-2] = 0
ev = ev_cnt.most_common(2)
od = od_cnt.most_common(2)
ans = n
for (k1, v1), (k2, v2) in itertools.product(ev, od):
    if k1 == k2:
        continue
    x = (n - v1 - v2)
    ans = min(ans, x)
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,C=[int(i) for i in input().split()]
list=[]
list.append(A)
list.append(B)
list.append(C)
max=max(list)
list.remove(max)

return 10*max+sum(list)


Fixed submission:
A,B,C=[int(i) for i in input().split()]
list=[]
list.append(A)
list.append(B)
list.append(C)
max=max(list)
list.remove(max)

print(10*max+sum(list))
Buggy python submission (verdict: Runtime Error):
import sys

def square():
    argvs=sys.argv
    print( int(argvs[1])*int(argvs[2])-int(argvs[1])-int(argvs[2])+1)

square()


Fixed submission:
def square():
    x,y=[int(i) for i in input().split()]
    print( x*y-x-y+1)

square()
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())
S_list = []
infinity = 50000000000000
S_str = str()
for i in range(len(S)):
    if int(S[i]) != 1:
        S_list.append(S[i])
        break
    else:
        pass
print(S_list[0])

Fixed submission:
S = input()
K = int(input())
flg = False
for i in range(K):
    if S[i] != '1':
        print(S[i])
        flg = False
        break
    else:
        flg = True
if flg:
    print('1')
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
ans = 'No'
if S == T:
    ans = 'Yes'
for i in range(len(S)):
    S = S[-1] + S
    S = S.rstrip(S[-1])
    if S == T:
        ans = 'Yes'
print(ans)

Fixed submission:
S = input()
T = input()
ans = 'No'
if S == T:
    ans = 'Yes'
for i in range(len(S)):
    S = S[-1] + S
    S = S[:-1]
    if S == T:
        ans = 'Yes'
print(ans)

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
ans = 'No'
for i in range(len(S)):
    S = S[-1] + S
    S = S.rstrip(S[-1])
    if S == T:
        ans = 'Yes'
print(ans)


Fixed submission:
S = input()
T = input()
ans = 'No'
if S == T:
    ans = 'Yes'
for i in range(len(S)):
    S = S[-1] + S
    S = S[:-1]
    if S == T:
        ans = 'Yes'
print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()
S = 0
for i in range(len(N)):
    S += int(N[i])
if N % S == 0:
    print('Yes')
else:
    print('No')


Fixed submission:
N = input()
S = 0
for i in range(len(N)):
    S += int(N[i])
if int(N) % S == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
def calculate_median(lst):
    lst.sort()
    median_right = lst[int(len(lst)/2)]
    median_left = lst[int(len(lst)/2)-1]
    return median_right, median_left


N = int(input())
X = list(map(int, input().split()))
X_copy = X.copy()
median_right, median_left = calculate_median(X)
for i in range(N):
    if X_copy[i] >= median_right:
        print(median_left)
    elif X_copy[i] < median_right:
        print(median_right)

Fixed submission:
from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
print(ceil((n-1)/(k-1)))

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


def calculate_median(lst):
    lst.sort()
    median_right = lst[int(len(lst)/2)]
    median_left = lst[int(len(lst)/2)-1]
    return median_right, median_left


N = int(input())
X = list(map(int, input().split()))
X_copy = X.copy()
median_right, median_left = calculate_median(X)
for i in range(N):
    if X_copy[i] >= median_right:
        print(median_left)
    elif X_copy[i] < median_right:
        print(median_right)

Fixed submission:
from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
print(ceil((n-1)/(k-1)))
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if (abs(b-a) <= d and abd(c-b) <= d) or abs(c-a) <= d:
    print('Yes')
else:
    print('No')

Fixed submission:
a, b, c, d = map(int, input().split())
if (abs(b-a) <= d and abs(c-b) <= d) or abs(c-a) <= d:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
a=input("数字を入力してください")
b=input("数字を入力してください")
c=input("数字を入力してください")
d=input("数字を入力してください")

if b-a<=d:
    if c-b<=d:
        print('Yes')
    else:
        print('No')
else:
    print('No')


Fixed submission:
a, b, c, d = map(int, input().split())
if (abs(b-a) <= d and abs(c-b) <= d) or abs(c-a) <= d:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x = int(input())
set_x = set(n**e for n in range(32) for e in range(2, 11) if n**e <= X)
ans = max(set_x)
print(ans)

Fixed submission:
x = int(input())
set_x = set(n**e for n in range(32) for e in range(2, 11) if n**e <= x)
ans = max(set_x)
print(ans)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
s_list = []
for i in range(W):
    s_list.append(input())
cnt = 0
for i in range(1, H):
    for j in range(1, W):
        if s_list[i][j] == '#':
            if s_list[i][j-1] != '#' and s_list[i-1][j] != '#'\
               and s_list[i][j+1] !='#' and s_list[i+1][j] != '#':
            cnt += 1
if cnt == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
h, w = map(int, input().split())
s = ['.' * (w+2)] + ['.' + input() + '.' for _ in [0]*h] + ['.' * (w+2)]
a = 'Yes'
for i in range(1, h+1):
    for j in range(1, w+1):
        if s[i][j] == '#':
            if s[i-1][j] == '.' and s[i+1][j] == '.' and s[i][j-1] == '.' and\
               s[i][j+1] == '.':
                a = 'No'
print(a)

Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
s_list = []
for i in range(W):
    s_list.append(input())
cnt = 0
for i in range(1, H):
    for j in range(1, W):
        if s_list[i][j] == '#' and s_list[i][j-1] != '#' and\
           s_list[i-1][j] != '#' and s_list[i][j+1] !='#' and\
                                                       s_list[i+1][j] != '#':
            cnt += 1
if cnt == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
h, w = map(int, input().split())
s = ['.' * (w+2)] + ['.' + input() + '.' for _ in [0]*h] + ['.' * (w+2)]
a = 'Yes'
for i in range(1, h+1):
    for j in range(1, w+1):
        if s[i][j] == '#':
            if s[i-1][j] == '.' and s[i+1][j] == '.' and s[i][j-1] == '.' and\
               s[i][j+1] == '.':
                a = 'No'
print(a)

Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
s_list = []
for i in range(W):
    s_list.append(input())
cnt = 0
for i in range(H):
    for j in range(1, W):
        if s_list[i][j] == '#' and s_list[i][j-1] != '#' and\
           s_list[i-1][j] != '#' and s_list[i][j+1] !='#' and\
                                                       s_list[i+1][j] != '#':
            cnt += 1
if cnt == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
h, w = map(int, input().split())
s = ['.' * (w+2)] + ['.' + input() + '.' for _ in [0]*h] + ['.' * (w+2)]
a = 'Yes'
for i in range(1, h+1):
    for j in range(1, w+1):
        if s[i][j] == '#':
            if s[i-1][j] == '.' and s[i+1][j] == '.' and s[i][j-1] == '.' and\
               s[i][j+1] == '.':
                a = 'No'
print(a)