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

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

ptn=list(itertools.combinations(xy,2))
pq=[]
for idx,val in enumerate(ptn):
        pq.append(str(val[1][0]-val[0][0]) + 'x' + str(val[1][1]-val[0][1]))

cpq = Counter(pq)

for i in range(1,N):
        pqans=cpq.most_common(i)[0][0]
        if pqans != '0x0':
                redsc=cpq.most_common(i)[0][1]
                break


print(N-redsc)

Fixed submission:
from collections import Counter
import itertools

N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
xy.sort()
if N == 1:
        print(1)
        exit()

ptn=list(itertools.combinations(xy,2))
pq=[]
for idx,val in enumerate(ptn):
        if val[1][0]-val[0][0] <= 0 and val[1][1]-val[0][1] <= 0:
                pq.append(str(abs(val[1][0]-val[0][0])) + 'x' + str(abs(val[1][1]-val[0][1])))
        else:
                pq.append(str(val[1][0]-val[0][0]) + 'x' + str(val[1][1]-val[0][1]))

cpq = Counter(pq)

# pqans=cpq.most_common(1)[0][0]
redsc=cpq.most_common(1)[0][1]

# p,q = map(int,pqans.split('x'))
print(N-redsc)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
import itertools

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


ptn=list(itertools.combinations(xy,2))
pq=[]
for idx,val in enumerate(ptn):
        pq.append(str(val[1][0]-val[0][0]) + 'x' + str(val[1][1]-val[0][1]))

cpq = Counter(pq)

# pqans=cpq.most_common(1)[0][0]
redsc=cpq.most_common(1)[0][1]

# p,q = map(int,pqans.split('x'))

print(N-redsc)

Fixed submission:
from collections import Counter
import itertools

N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
xy.sort()
if N == 1:
        print(1)
        exit()

ptn=list(itertools.combinations(xy,2))
pq=[]
for idx,val in enumerate(ptn):
        if val[1][0]-val[0][0] <= 0 and val[1][1]-val[0][1] <= 0:
                pq.append(str(abs(val[1][0]-val[0][0])) + 'x' + str(abs(val[1][1]-val[0][1])))
        else:
                pq.append(str(val[1][0]-val[0][0]) + 'x' + str(val[1][1]-val[0][1]))

cpq = Counter(pq)

# pqans=cpq.most_common(1)[0][0]
redsc=cpq.most_common(1)[0][1]

# p,q = map(int,pqans.split('x'))
print(N-redsc)
Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())

S = input()
S_bef = int(S[:2])
S_aft = int(S[-2:])

is_bef_yy = False
is_bef_mm = False
is_aft_yy = False
is_aft_mm = False

if S_bef >= 1 and S_bef <= 12:
    is_bef_mm = True
if S_bef >= 0:
    is_bef_yy = True
if S_aft >= 1 and S_aft <= 12:
    is_aft_mm = True
if S_aft >= 0:
    is_aft_yy = True

if is_bef_yy and is_bef_mm and is_aft_yy and is_aft_mm:
    print('AMBIGUOUS')
elif is_bef_yy and is_aft_mm:
    print('YYMM')
elif is_aft_yy and is_bef_mm:
    print('MMYY')
else:
    print('NA')



Fixed submission:
S = input()
S_bef = int(S[:2])
S_aft = int(S[-2:])

is_bef_yy = False
is_bef_mm = False
is_aft_yy = False
is_aft_mm = False

if S_bef >= 1 and S_bef <= 12:
    is_bef_mm = True
if S_bef >= 0:
    is_bef_yy = True
if S_aft >= 1 and S_aft <= 12:
    is_aft_mm = True
if S_aft >= 0:
    is_aft_yy = True

if is_bef_yy and is_bef_mm and is_aft_yy and is_aft_mm:
    print('AMBIGUOUS')
elif is_bef_yy and is_aft_mm:
    print('YYMM')
elif is_aft_yy and is_bef_mm:
    print('MMYY')
else:
    print('NA')
Buggy python submission (verdict: Runtime Error):
X = [list(map(int, input().split())) for i in range(5)]
k = int(input())
print('Yay!') if max(X) - min(X) >= k else print(':(')

Fixed submission:
antenas = [int(input()) for i in range(5)]
k = int(input())
if k == 0:
    print('Yay!')
    exit()
print('Yay!') if max(antenas) - min(antenas) <= k else print(':(')
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
print('Yes') if A+B/C*2 == 1 print('No')

Fixed submission:
A,B,C = map(int, input().split())
print('Yes') if A+B>C and C+B>A and A+C>B and A==B and B==C else print('No')

Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
print('Yes') if abs(A-B)<C and A+B>C and A=B and B=C else print('No')

Fixed submission:
A,B,C = map(int, input().split())
print('Yes') if A+B>C and C+B>A and A+C>B and A==B and B==C else print('No')
Buggy python submission (verdict: Runtime Error):
S = list(input())
ansarr = []
ans = 0
for i in S:
    if ans == 0:
        if i == 'A' or i == 'C' or i == 'G' or i == 'T':
            ans += 1
    else:
        if i == 'A' or i == 'C' or i == 'G' or i == 'T':
            ans += 1
        elif i != 'A' or i != 'C' or i != 'G' or i != 'T':
            ansarr.append(ans)
            ans = 0

print(max(ansarr))


Fixed submission:
S = list(input())
ansarr = []
ans = 0
ansarr.append(ans)
for i in S:
    if ans == 0:
        if i == 'A' or i == 'C' or i == 'G' or i == 'T':
            ans += 1
    else:
        if i == 'A' or i == 'C' or i == 'G' or i == 'T':
            ans += 1
        elif i != 'A' or i != 'C' or i != 'G' or i != 'T':
            ansarr.append(ans)
            ans = 0
else:
    ansarr.append(ans)


print(max(ansarr))
Buggy python submission (verdict: Runtime Error):
N,M,C = map(int, input().split())
B = list(map(int, input().split()))
A = []
counter = 0
for i in range(N):
    A.append(list(map(int, input().split())))
    val = 0
    for j in range(M):
        val += A[i][j] * B[j]
    else:
        if val + C > 0:
            count += 1 
print(count)


Fixed submission:
N,M,C = map(int, input().split())
B = list(map(int, input().split()))
A = []
counter = 0
for i in range(N):
    A.append(list(map(int, input().split())))
    val = 0
    for j in range(M):
        val += A[i][j] * B[j]
    else:
        if val + C > 0:
            counter += 1 
print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
init_len = len(S)

while True:
    cur_len = len(S)
    S = S.replace("01", "")
    S = S.replace("10", "")
    if len(S) == cur_len:
        print(init_len - cur_len)
        exit()


Fixed submission:
S = list(input())

zero_S = S.count('0')
one_S = S.count('1')

print(min(zero_S, one_S) * 2)

Buggy python submission (verdict: Runtime Error):
S = list(input())
cnt = 0
i = 0
while True:
    if S[i] != S[i + 1]:
        del S[i:i+2]
        cnt += 1
        i = 0
        continue
    elif i + 2 == len(S):
        print(cnt * 2)
        exit()
    i += 1







Fixed submission:
S = list(input())

zero_S = S.count('0')
one_S = S.count('1')

print(min(zero_S, one_S) * 2)
Buggy python submission (verdict: Runtime Error):
A,B = map(input().split())
print(A + B) if B % A == 0 else print(B - A)

Fixed submission:
A,B = map(int, input().split())
print(A + B) if B % A == 0 else print(B - A)
Buggy python submission (verdict: Runtime Error):
T,X = map(int, input().split())
print(t/X)

Fixed submission:
T,X = map(int, input().split())
print(T/X)
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
print(max(A,B,C)*9+sum(A,B,C))


Fixed submission:
A,B,C = map(int, input().split())
print(max(A,B,C)*9+A+B+C)
Buggy python submission (verdict: Runtime Error):
H,W = map(int, input().split())
a = [list(input()) for i in range(W)]
a = [x for x in a if '#' in x]

aT = list(zip(*a))
aT = [x for x in aT if '#' in x]
ans = list(zip(*aT))

for i in ans:
    print("".join(i))


Fixed submission:
H,W = map(int, input().split())
a = [list(input()) for i in range(H)]
a = [x for x in a if '#' in x]

aT = list(zip(*a))
aT = [x for x in aT if '#' in x]
ans = list(zip(*aT))

for i in ans:
    print("".join(i))
Buggy python submission (verdict: Runtime Error):
N = int(input())
ln = list(N)
print('Yes') if N%sum(ln) == 0 else print('No')


Fixed submission:
N = int(input())
ln = list(str(N))
sumln = 0
for val in ln:
    sumln += int(val)

print('Yes') if N%sumln == 0 else print('No')
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
var = list(range(A, B + 1))
ans = var[0:K]
ans += var[-K:]
ans = list(set(ans))
ans.sort()
for i in ans:
    print(i)


Fixed submission:
A,B,K = map(int, input().split())
lcnt = 0
rcnt = 0
ans = []
for i in range(A, min(A + K, B)):
    ans.append(i)

for i in range(max(B - K + 1, A), B + 1):
    ans.append(i)

set_ans = list(set(ans))
set_ans.sort()
for i in set_ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
var = list(range(A, B + 1))
ans = var[0:K]
ans += var[-K:]
ans = set(ans)
for i in ans:
    print(i)


Fixed submission:
A,B,K = map(int, input().split())
lcnt = 0
rcnt = 0
ans = []
for i in range(A, min(A + K, B)):
    ans.append(i)

for i in range(max(B - K + 1, A), B + 1):
    ans.append(i)

set_ans = list(set(ans))
set_ans.sort()
for i in set_ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
var = list(range(A, B + 1))
print(var)
ans = var[0:2]
ans += var[-2:]

for i in ans:
    print(i)


Fixed submission:
A,B,K = map(int, input().split())
lcnt = 0
rcnt = 0
ans = []
for i in range(A, min(A + K, B)):
    ans.append(i)

for i in range(max(B - K + 1, A), B + 1):
    ans.append(i)

set_ans = list(set(ans))
set_ans.sort()
for i in set_ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
s = input()
cnt = 0
cntflg = False
endflg = False
for i in s:
        if i == 'Z' and cntflg:
                cnt += 1
                endflg = True
        elif i == 'Z' and endflg:
                cnt += 1
        elif endflg
                break
        elif cntflg:
                cnt += 1
        elif i == 'A' and not(cntflg):
                cnt = 1
                cntflg = True

print(cnt)


Fixed submission:
s = input()
left = 0
right = 0

for idx, val in enumerate(s):
        if val == 'A':
                left = idx
                break

for idx, val in enumerate(reversed(s)):
        if val == 'Z':
                right = idx
                break

print(len(s) - left - right)

Buggy python submission (verdict: Runtime Error):
s = input()
cnt = 0
cntflg = True
for i in s:
  if i == 'Z':
    break
  elif cntflg:
    cnt += 1
  elif i == 'A'
  	cnt = 1
    cntflg = True

print(cnt)

Fixed submission:
s = input()
left = 0
right = 0

for idx, val in enumerate(s):
        if val == 'A':
                left = idx
                break

for idx, val in enumerate(reversed(s)):
        if val == 'Z':
                right = idx
                break

print(len(s) - left - right)
Buggy python submission (verdict: Time Limit Exceeded):

K,S = map(int, input().split())
cnt = 0
K += 1
for X in range(K):
    if X > S:
        break
    for Y in range(K):
        if X + Y > S:
            break
        for Z in range(K):
            if X + Y + Z == S:
                cnt += 1
            if X + Y + Z > S:
                break

print(cnt)


Fixed submission:

K,S = map(int, input().split())
cnt = 0

for X in range(K + 1):
    if S - X < 0:
        break
    for Y in range(K + 1):
        if S - X - Y < 0:
            break
        if S - X - Y <= K:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int, input().split())
cnt = 0
K += 1
for X in range(K):
    for Y in range(K ):
        for Z in range(K):
            if X + Y + Z == S:
                cnt += 1
print(cnt)


Fixed submission:

K,S = map(int, input().split())
cnt = 0

for X in range(K + 1):
    if S - X < 0:
        break
    for Y in range(K + 1):
        if S - X - Y < 0:
            break
        if S - X - Y <= K:
            cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
in=input()
A=in.split()
A1=int(A[0])
A2=int(A[1])
A3=int(A[2])
if A1+A2+A3 > 21:
  print("bust ")
else:
  print("win ")















Fixed submission:
inp = input()
A = inp.split()
A1 = int(A[0])
A2 = int(A[1])
A3 = int(A[2])
if A1+A2+A3 > 21:
    print("bust ")
else:
    print("win ")
Buggy python submission (verdict: Runtime Error):
import collections

s = [int(i) for i in input().split(" ")]
print(s)
p = [int(i) for i in input().split(" ")]
print(p)
a = []
p.sort()
print(p)

for i in range(0,s[1]):
	a = p[i]
b = [int(b) for b in a]
print(sum(b))


Fixed submission:
import collections

s = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]
p.sort()
a = []

for i in range(0,s[1]):
	a.append(p[i])
print(sum(a))
Buggy python submission (verdict: Runtime Error):
A, B = [i for i in input()]
B = int(100 * float(B))
tmp = A * B
print(tmp // 100)

Fixed submission:
A, B = [i for i in input().split(" ")]
B = B.replace(".","")
tmp = int(A) * int(B) // 100

print(tmp)
Buggy python submission (verdict: Time Limit Exceeded):
from numba import jit

def gcd(a,b):
    if b == 0: return a
    else: return gcd(b, a % b)

@jit
def main2(K):
    ans = 0
    for i in range(1,K+1):
        for j in range(1,K+1):
            for k in range(1,K+1):
                ans += gcd(gcd(i,j),k)
    return ans    


K = int(input())
print(main2(K))

Fixed submission:
from numba import jit

@jit
def gcd(a,b):
    if b == 0: return a
    else: return gcd(b, a % b)

@jit
def main2(K):
    ans = 0
    for i in range(1,K+1):
        for j in range(1,K+1):
            tmp = gcd(i,j)
            for k in range(1,K+1):
                ans += gcd(tmp,k)
    return ans    


K = int(input())
print(main2(K))

Buggy python submission (verdict: Time Limit Exceeded):
from numba import jit

@jit
def gcd(a,b):
    if b == 0: return a
    else: return gcd(b, a % b)

K = int(input())

ans = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans += gcd(gcd(i,j),k)
print(ans)

Fixed submission:
from numba import jit

@jit
def gcd(a,b):
    if b == 0: return a
    else: return gcd(b, a % b)

@jit
def main2(K):
    ans = 0
    for i in range(1,K+1):
        for j in range(1,K+1):
            tmp = gcd(i,j)
            for k in range(1,K+1):
                ans += gcd(tmp,k)
    return ans    


K = int(input())
print(main2(K))
Buggy python submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split(" ")]

def replace(a,b):
    if a < abs(a - b):
        return a
    else:
        return replace(abs(a - b), b)

if K == 0:
    print(N)
elif N % K == 0:
    print(0)
else:
    print(replace(N, K))

Fixed submission:
N, K = [int(i) for i in input().split(" ")]

def replace(a,b):
    if a < abs(a - b):
        return a
    else:
        return replace(abs(a - b), b)

if K == 0:
    print(N)
elif N % K == 0:
    print(0)
else:
    print(replace(N%K, K))
Buggy python submission (verdict: Runtime Error):
N,M = [int(i) for i in input().split(" ")]
check_list = []

for _ in range(M):
    check_list.append([int(i) for i in input().split(" ")])

for i in range(10 ** (N + 1)):
    i = str(i)
    for j in check_list:
        if i[j[0] - 1] != str(j[1]):
            break
        else:
            continue
    else:
        print(i)
        break
else:
    print(-1)

Fixed submission:
N,M = [int(i) for i in input().split(" ")]
check_list = []

for _ in range(M):
    check_list.append([int(i) for i in input().split(" ")])

for i in range(10 ** N):
    i = str(i)
    if len(i) != N:
        continue

    for j in check_list:
        if i[j[0] - 1] != str(j[1]):
            break
        else:
            continue
    else:
        print(i)
        break
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
S = [i for i in input()]
t = [i for i in input()]

a = 0
for i,j in zip(s,t):
  if i == j:
    a += 1
    
print(a)

Fixed submission:
s = [i for i in input()]
t = [i for i in input()]

a = 0
for i,j in zip(s,t):
  if i == j:
    a += 1
    
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
import math

N = int(input())

word_dict = []
num = []

for i in range(N):
    s = input()
    count = collections.Counter(s)
    if count in word_dict:
        num[word_dict.index(count)] += 1
    else:
        word_dict.append(count)
        num.append(0)

ans = 0

for i in num:
    i += 1
    if i >= 3:
        ans = ans + (math.factorial(i) // (math.factorial(i - 2) * math.factorial(2)))
    elif i == 2:
        ans += 1

print(ans)


Fixed submission:
import collections
import math

N = int(input())
word_dict = {}

ans = 0

for _ in range(N):
    s = input()
    s = "".join(sorted(s))
    if s in word_dict:
        ans += word_dict[s]
        word_dict[s] += 1
    else:
        word_dict[s] = 1
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import math

N = int(input())

word_dict = []
num = []

for i in range(N):
    s = [i for i in input()]
    count = collections.Counter(s)
    if count in word_dict:
        num[word_dict.index(count)] += 1
    else:
        word_dict.append(count)
        num.append(0)

ans = 0

for i in num:
    i += 1
    if i >= 3:
        ans = ans + (math.factorial(i) // (math.factorial(i - 2) * math.factorial(2)))
    elif i == 2:
        ans += 1
    else:
        continue

print(ans)


Fixed submission:
import collections
import math

N = int(input())
word_dict = {}

ans = 0

for _ in range(N):
    s = input()
    s = "".join(sorted(s))
    if s in word_dict:
        ans += word_dict[s]
        word_dict[s] += 1
    else:
        word_dict[s] = 1
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import math

N = int(input())

word_dict = []
num = [0 for _ in range(10**5)]

for i in range(N):
    s = [i for i in input()]
    count = collections.Counter(s)
    if count in word_dict:
        num[word_dict.index(count)] += 1
    else:
        word_dict.append(count)

ans = 0

for i in num:
    i += 1
    if i >= 3:
        ans = ans + (math.factorial(i) // (math.factorial(i - 2) * math.factorial(2)))
    elif i == 2:
        ans += 1
    else:
        continue

print(ans)


Fixed submission:
import collections
import math

N = int(input())
word_dict = {}

ans = 0

for _ in range(N):
    s = input()
    s = "".join(sorted(s))
    if s in word_dict:
        ans += word_dict[s]
        word_dict[s] += 1
    else:
        word_dict[s] = 1
    
print(ans)
Buggy python submission (verdict: Runtime Error):
r = input()
print(3 * r**2)

Fixed submission:
r = int(input())
print(3 * r**2 )
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]

for i in range(N):
    if i == 0:
        print(max(A[1:]))
        continue
    elif i == N-1:
        print(max(A[:N]))
        continue
    
    a_l = max(A[:i])
    a_h = max(A[i+1:])
    
    if a_l >= a_h:
        print(a_l)
    else:
        print(a_h)
    

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

for i in A:
    if (A_s[0] == i) & (A_s[1] == i):
        print(A_s[0])
    elif (A_s[0] == i) & (A_s[0] != A_s[1]):
        print(A_s[1])
    else:
        print(A_s[0])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for _ in range(N)]

sum_index = [0]*(N+1)

for i in range(N)[::-1]:
    sum_ = 0    
    for j in sum_index[i+1::i+1]:
        sum_ ^= j
    sum_index[i+1] = sum_ ^ A[i] 
print(sum(sum_index))
print(sum_index[1:])

Fixed submission:
N = int(input())
A = [int(i) for i in input().split(" ")]

sum_index = [0]*(N+1)
index = []
for i in range(N)[::-1]:
    sum_ = 0
    for j in sum_index[i+1::i+1]:
        sum_ ^= j
    sum_index[i+1] = sum_ ^ A[i]
    if sum_index[i+1] == 1:
        index.append(str(i+1))

print(sum(sum_index))
if index:
    print(" ".join(index))
Buggy python submission (verdict: Time Limit Exceeded):
import copy
import numpy as np

N,M = [int(i) for i in input().split(" ")]
ans = np.array([True for _ in range(N)])
ans_ng = ans[::] & False
ans_num = 0

for _ in range(M):
    ans_cp = copy.deepcopy(ans_ng)
    L,R = [int(i) for i in input().split(" ")]
    ans_cp[L-1:R] = True
    ans = ans & ans_cp

for i in ans:
    if i:
        ans_num += 1

print(ans_num)

Fixed submission:
N,M = [int(i) for i in input().split(" ")]
ans_L = 0
ans_R = 1e5+1

for _ in range(M):
    L,R = [int(i) for i in input().split(" ")]
    if ans_L < L:
        ans_L = L
    if ans_R > R:
        ans_R = R

if (ans_R - ans_L) >= 0:
    print(ans_R - ans_L + 1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
while True:
    line = [int(i) for i in input().split(" ")]
    b = line[0]
    flag = 0
    for i in line:
        if i != b:
            flag = 1
    if flag == 1:
        print("No")
    else:
        print("Yes")

Fixed submission:

line = [int(i) for i in input().split(" ")]
b = line[0]
flag = 0
for i in line:
    if i != b:
        flag = 1
if flag == 1:
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
a = int(input())
line = [i for i in a if i]
b = line[0]
for i in line:
  if i != b:
    return print("No")
print("Yes")

Fixed submission:

line = [int(i) for i in input().split(" ")]
b = line[0]
flag = 0
for i in line:
    if i != b:
        flag = 1
if flag == 1:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
money  = [1000,5000,10000]
n,k = list(map(int,input().split()))

def calc_num(n,y):
    for i in range(n+1):
        for j in range((n+1)-i):
            for k in range((n+1)-(i+j)):
                if money[0]*i + money[1]*j + money[2]*k == y and i+j+k == n:
                    return[i,j,k]
    return[-1,-1,-1]

o = calc_num(n,k)[::-1]
print(o[0],o[1],o[2])
                

Fixed submission:
money  = [1000,5000,10000]
n,k = list(map(int,input().split()))

def calc_num(n,y):
    for i in range(n+1):
        for j in range((n+1)-i):
            if money[0]*i + money[1]*j + money[2]*(n-(i+j)) == y and i+j+(n-(i+j)) == n:
                return[n-(i+j),j,i]
    return[-1,-1,-1]

o = calc_num(n,k)
print(o[0],o[1],o[2])
Buggy python submission (verdict: Runtime Error):
st = [i for i in "AKIHABARA"]
input_st = [i for i in input()]
if input_st[-1] != "A":
    input_st.append("A")
for ind,str_ in enumerate(st):
    if str_ != input_st[ind]:
        input_st.insert(ind,"A")
    else:
        pass
if "".join(st) == "".join(input_st):
    print("YES")
else:
    print("NO")


Fixed submission:
import re
pattern = r"^A?KIHA?BA?RA?$"
S = input()
if re.match(pattern,S):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
st = [i for i in "AKIHABARA"]
input_st = [i for i in input()]
if input_st[-1] != "A":
    input_st.append("A")
for ind,str_ in enumerate(st):
    if str_ != input_st[ind]:
        input_st.insert(ind,"A")
    
if "".join(st) == "".join(input_st):
    print("YES")
else:
    print("NO")


Fixed submission:
import re
pattern = r"^A?KIHA?BA?RA?$"
S = input()
if re.match(pattern,S):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
k,s = list(map(int,input().split()))
ans = [1 for x in range(k+1) for y in range(k+1) for z in range(k+1) if x + y + z == s]
print(len(ans))

Fixed submission:
k,s = list(map(int,input().split()))
ans = [1 for x in range(k+1) for y in range(k+1) if 0 <= s - (x+y) <= k]
print(len(ans))

Buggy python submission (verdict: Time Limit Exceeded):
k,s = list(map(int,input().split()))
ans = [x + y + z for x in range(k+1) for y in range(k+1) for z in range(k+1) if x + y + z == s]
print(len(ans))

Fixed submission:
k,s = list(map(int,input().split()))
ans = [1 for x in range(k+1) for y in range(k+1) if 0 <= s - (x+y) <= k]
print(len(ans))
Buggy python submission (verdict: Runtime Error):
α　= input()
if α.isupper():
    print('A')
else:
    print('a')

Fixed submission:
a = input()
print('A' if a.isupper() else 'a')

Buggy python submission (verdict: Runtime Error):
α　= input('input your favorite alpabet:')
if α.isupper():
    print('A')
elif α.islower:
    print('a')


Fixed submission:
a = input()
print('A' if a.isupper() else 'a')
Buggy python submission (verdict: Runtime Error):
a, b, c, k = input().split(" ")

"""
print(a)
print(b)
print(c)
print(k)
"""
if a >= k:
    print(a)

elif (a + b) >= k:
    print(a)

else:
    print(a-c)


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


"""
print(a)
print(b)
print(c)
print(k)
"""
if a >= k:
    print(k)

elif (a + b) >= k:
    print(a)

else:
    print(a - (k - a - b))