Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
N = int(input())
def gcd(*numbers):
    return reduce(math.gcd, numbers)
a = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            a+= gcd(i,j,k)
            #print(i,j,k)
print(a)

Fixed submission:
K =int(input())
l = [0, 1, 9, 30, 76, 141, 267, 400, 624, 885, 1249, 1590, 2208, 2689, 3411, 4248, 5248, 6081, 7485, 8530, 10248, 11889, 13687, 15228, 17988, 20053, 22569, 25242, 28588, 31053, 35463, 38284, 42540, 46581, 50893, 55362, 61824, 65857, 71247, 76884, 84388, 89349, 97881, 103342, 111528, 120141, 128047, 134580, 146316, 154177, 164817, 174438, 185836,194157,207927, 218812, 233268, 245277, 257857, 268182, 288216, 299257, 313635, 330204, 347836, 362973, 383709, 397042, 416448, 434025, 456967, 471948, 499740, 515581, 536073, 559758, 583960, 604833, 633651, 652216, 683712, 709065, 734233, 754734, 793188, 818917, 846603, 874512, 909496, 933081, 977145, 1006126, 1041504, 1073385, 1106467, 1138536, 1187112, 1215145, 1255101, 1295142, 1342852, 1373253, 1422195, 1453816, 1502376, 1553361, 1595437, 1629570, 1691292, 1726717, 1782111, 1827492, 1887772, 1925853, 1986837, 2033674, 2089776, 2145333, 2197483, 2246640, 2332104, 2379085, 2434833, 2490534, 2554600, 2609625, 2693919, 2742052, 2813988, 2875245, 2952085, 3003306, 3096024, 3157249, 3224511, 3306240, 3388576, 3444609, 3533637, 3591322, 3693924, 3767085, 3842623, 3912324, 4027884, 4102093, 4181949, 4270422, 4361548, 4427853, 4548003, 4616104, 4718640, 4812789, 4918561, 5003286, 5131848, 5205481, 5299011, 5392008, 5521384, 5610705, 5739009, 5818390, 5930196, 6052893, 6156139, 6239472, 6402720, 6493681, 6623853, 6741078, 6864016, 6953457, 7094451, 7215016, 7359936, 7475145, 7593865, 7689630, 7886244, 7984165, 8130747, 8253888, 8403448, 8523897, 8684853, 8802826, 8949612, 9105537, 9267595, 9376656, 9574704, 9686065, 9827097, 9997134, 10174780, 10290813,10493367, 10611772,10813692]
print(l[K])
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))

Fixed submission:
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i)))) <= b:
        ans += i
print(ans)

Fixed submission:
n, a, b = map(int, input().split())
ans = 0
for i in range(n + 1):
    if a <= sum(list(map(int, list(str(i))))) <=b:
        ans += i
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for _ in a:
    ans = min(len(bin(_) - bin(_).rfind("1") - 1)
print(round(ans))

Fixed submission:
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for _ in a:
    ans = min(ans, len(bin(_)) - bin(_).rfind("1") - 1)
print(round(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N + 1):
    if i % 3 == 0 or i % 5 == 0:
        continue
    t = t + i
print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(1,N + 1):
    if i % 3 == 0 or i % 5 == 0:
        continue
    total = total + i
print(total)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
hit = 0
for i in range(3):
    if S[i] == T[i]:
        hit = hit + 1
print(hit)

Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
if "a" * b > "b" * a:
    print("b" * a)
else:
    print("a" * b)

Fixed submission:
a,b = input().split()
if a * int(b) > b * int(a):
    print(b * int(a))
else:
    print(a * int(b))
Buggy python submission (verdict: Runtime Error):
# S,T = input().split()
A,B,K = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# s= input()
if A >= K:
    print(A - K,B)
elif A + B >=K:
    print(0,A + B - K)
else:
    print(0,0)

Fixed submission:
S,T = input().split()
print(T+S)

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# s= input()
if A >= K:
    print(A - K,B)
elif A + B >=K:
    print(0,A + B - K)
else:
    print(0)

Fixed submission:
S,T = input().split()
print(T+S)
Buggy python submission (verdict: Runtime Error):
S = input()
day = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
n = day.index(s)
print(7 - n)

Fixed submission:
s = input()
day = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
n = day.index(s)
print(7 - n)
Buggy python submission (verdict: Runtime Error):
X = input()
A = ["Sunny","Cloudy","Rainy"]
N = (index(x) + 1) % 3
print(A.[N])

Fixed submission:
x = input()
A = ["Sunny","Cloudy","Rainy"]
N = (A.index(x) + 1) % 3
print(A[N])
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = int(input())
# C = int(input())
# b = input()
print(s if a >= 3200 else "red")

Fixed submission:
a = int(input())
# s = int(input())
# C = int(input())
s= input()
print(s if a >= 3200 else "red")
Buggy python submission (verdict: Runtime Error):
K,X = map(int, input().split())
max = X + K - 1
min = X - k + 1
for i in range(min,max):
    print(i,end="\t")

Fixed submission:
K,X = map(int, input().split())
max = X + K 
min = X - K + 1
for i in range(min,max):
    print(i,end=" ")
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
print(min(S*N,B))

Fixed submission:
N,A,B = map(int,input().split())
print(min(A*N,B))
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input())
print(min(B//A,C))

Fixed submission:
A,B,C = map(int,input().split())
print(min(B//A,C))

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

Fixed submission:
A,B,C = map(int,input().split())
print(min(B//A,C))
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split(/)
A = a + b + c
if A <= "20190430" :
    print("Heisei")
else :
    print("TBD")

Fixed submission:
a,b,c = input().split("/")
A = a + b + c
if A <= "20190430" :
    print("Heisei")
else :
    print("TBD")
Buggy python submission (verdict: Runtime Error):
T,N = map(int, input().split())
print(T / X)

Fixed submission:
T,X = map(int, input().split())
print(T / X)
Buggy python submission (verdict: Runtime Error):
D = int(input().split())
print("Christmas" + "Eve" * (25 - D))

Fixed submission:
D = int(input())
print("Christmas" + " Eve" * (25 - D))

Buggy python submission (verdict: Runtime Error):
D = int(input().split())
print("Christmas" + "Eve" * (25 - D)

Fixed submission:
D = int(input())
print("Christmas" + " Eve" * (25 - D))
Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in range(26):
    for j in range(15):
        if 4*i + 7*j == N
        print("Yes")
        exit()
print("No")

Fixed submission:
N = int(input())
for i in range(26):
    for j in range(15):
        if 4*i + 7*j == N:
            print("Yes")
            exit()
print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
print(S.count(+) - S.count(-))

Fixed submission:
S = input()
print(S.count("+") - S.count("-"))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
results = []
for i in range(1,N):
    for j in range(1,N):
        if i+j == N:
            si = str(i)
            sj = str(j)
            count1 = 0
            for x in si:
                count1 += int(x)
            for y in sj:
                count1 += int(y)
            results.append(count1)
print(min(results))

Fixed submission:
N = int(input())
results = []
for i in range(1,N):
    results.append(sum(map(int,str(i))) + sum(map(int,str(N-i))))
print(min(results))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
results = []
for i in range(1,N+1):
    for j in range(1,N+1):
        if i+j == N:
            si = str(i)
            sj = str(j)
            count1 = 0
            for x in si:
                count1 += int(x)
            for y in sj:
                count1 += int(y)
            results.append(count1)
print(min(results))

Fixed submission:
N = int(input())
results = []
for i in range(1,N):
    results.append(sum(map(int,str(i))) + sum(map(int,str(N-i))))
print(min(results))
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int, input().split())
List = [i for i in range(A,B+1)]
s = List[0:K]
r = List[::-1]
l = r[0:K]
for i in l:
    s.append(i)
w = sorted(set(s))
for j in w:
    print(j)

Fixed submission:
A,B,K = map(int, input().split())
if B-A+1 >= K:
    s = [i for i in range(A,A+K)]
    l = [j for j in range(B-K+1,B+1)]
    for k in l:
        s.append(k)
    w = sorted(set(s))
else:
    w = [b for b in range(A,B+1)]
for j in w:
    print(j)
Buggy python submission (verdict: Runtime Error):
A,B,C,B = [int(input()) for i in range(4)]
print(min(A,B) + min(C,D))

Fixed submission:
A,B,C,D = [int(input()) for i in range(4)]
print(min(A,B) + min(C,D))
Buggy python submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500 * i + 100 * j + 50 * k == X:
                count += 1
print(count)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
print((X - A) % B)
Buggy python submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for _ in range(4)]
count = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if i+j+k = X
            count += 1
print(count)

Fixed submission:
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500 * i + 100 * j + 50 * k == X:
                count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(C + 1):
            if 500 * A + 100 * B + 50 * C == X:
                count += 1
print(count)

Fixed submission:
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500 * i + 100 * j + 50 * k == X:
                count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# X = input()
L = A + B
R = C + D
print("Left" if L > R else "Balanced" if L = R else "Right")

Fixed submission:
A,B,C,D = map(int, input().split())
# A = int(input())
# B = int(input())
# C = int(input())
# X = input()
L = A + B
R = C + D
print("Left" if L > R else "Balanced" if L == R else "Right")
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
import math
print(mith.ceil((a + b) / 2)

Fixed submission:
a,b = map(int, input().split())
import math
print(math.ceil((a + b) / 2))
Buggy python submission (verdict: Runtime Error):
N = input()
print("Yes" if N % sum(map(int,N)) == 0 else "No")

Fixed submission:
N = input()
print("Yes" if int(N) % sum(map(int,N)) == 0 else "No")
Buggy python submission (verdict: Runtime Error):
s = input()
print(s.[::2])

Fixed submission:
s = input()
print(s[::2])

Buggy python submission (verdict: Runtime Error):
s = input()
print(s.[1::2])

Fixed submission:
s = input()
print(s[::2])

Buggy python submission (verdict: Runtime Error):
s = input()
print(s.[::1])

Fixed submission:
s = input()
print(s[::2])
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int,input())
if abs(a-x) > abs(b-x):
    print("B")
else:
    print("A")

Fixed submission:
x,a,b = map(int,input().split())
if abs(a-x) > abs(b-x):
    print("B")
else:
    print("A")

Buggy python submission (verdict: Runtime Error):
x,a,b = map(int,input())
if abs(a-x) > abs(b-x):
    print("A")
else:
    print("B")

Fixed submission:
x,a,b = map(int,input().split())
if abs(a-x) > abs(b-x):
    print("B")
else:
    print("A")
Buggy python submission (verdict: Runtime Error):
s = input()
S = len(s) - 2
print(s[0] + S + s[-1])

Fixed submission:
s = input()
S = len(s) - 2
print(s[0] + str(S) + s[-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
i = 1
while i <= N:
    i = i*2
peint(i//2)

Fixed submission:
N = int(input())
i = 1
while i <= N:
    i = i*2
print(i//2)
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):
        z = S-x-y
        if z >=0 and z <=K:
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int, input().split())
count = 0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i + j + k == 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):
        z = S-x-y
        if z >=0 and z <=K:
            count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
s = input().split();
a = int(s[0]);
b = int(s[1]);
c = int(s[2]);
k = int(s[3]);
max = 0;
while(k > 0):
    if(a > 0):
        max += 1;
        a -= 1;
        k -= 1;
    elif(b > 0):
        b -= 1;
        k -= 1;
    else:
        max -= 1;
        k -= 1;


print(max);

Fixed submission:
s = input().split();
a = int(s[0]);
b = int(s[1]);
c = int(s[2]);
k = int(s[3]);
max = 0;
x = a;
if( (a - k) >= 0 ):
    max = k;
elif((a + b - k) >= 0):
    max = a;
else:
    k = k - (a + b);
    max = -k;
    max = max + a;

print(max);

Buggy python submission (verdict: Time Limit Exceeded):
s = input().split();
a = int(s[0]);
b = int(s[1]);
c = int(s[2]);
k = int(s[3]);
max = 0;
while(k > 0):
    if(a > 0):
        max += 1;
        a -= 1;
        k -= 1;
    elif(b > 0):
        b -= 1;
        k -= 1;
    elif(c > 0):
        max -= 1;
        k -= 1;


print(max);

Fixed submission:
s = input().split();
a = int(s[0]);
b = int(s[1]);
c = int(s[2]);
k = int(s[3]);
max = 0;
x = a;
if( (a - k) >= 0 ):
    max = k;
elif((a + b - k) >= 0):
    max = a;
else:
    k = k - (a + b);
    max = -k;
    max = max + a;

print(max);
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input());
n1 = 0;
n2 = 0;
if(x == 1):
    n1 = 0;
    n2 = -1;
    print(n1, n2);
flag = False;

if(x != 1):
    for i in range(x):
        for j in range(x):
            if((i * i * i * i * i) - (-(j * j * j * j * j)) == x ):
                print(i, -j);
                flag = True;
                break;
        if(flag):
            break;

Fixed submission:
x = int(input());
n1 = 0;
n2 = 0;
if(x == 1):
    n1 = 0;
    n2 = -1;
    print(n1, n2);
flag = False;

if(x != 1):
    for i in range(1000):
        for j in range(1000):
            if((i * i * i * i * i) - (-(j * j * j * j * j)) == x ):
                print(i, -j);
                flag = True;
                break;
            if ((i * i * i * i * i) - ((j * j * j * j * j)) == x):
                print(i, j);
                flag = True;
                break;
        if(flag):
            break;
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input());
i= list(map(int,input().split()));

a = int(i[0]);
b = int(i[1]) ;
flag = False;

while a <= b:
    if a % k == 0:
        flag = True;
        break;
    else:
        continue;
    a += 1;

if(flag):
    print("OK");
else:
    print("NG");



Fixed submission:
k = int(input());
i= list(map(int,input().split()));

a = int(i[0]);
b = int(i[1]) ;
flag = False;


while(a <= b):
    if a % k == 0:
        flag = True;
        break;
    else:
        a += 1;

if(flag):
    print("OK");
else: print("NG");
Buggy python submission (verdict: Runtime Error):

class Main:

    t1, a1, t2, a2= map(int,input().split());

    while(t1 > 0 and t2 > 0):
        if t2 <= 0:
            break;
        t2 -= a1;
        if t1 <= 0:
            break;
        t1 -= a2;

    if t1 >= t2:
        print("Yes");
    else:
        print("No")



Fixed submission:
class Main:

    s1, s2= map(int,input().split());

    if s1 <= s2:
        print("unsafe");
    else:
        print("safe");

Buggy python submission (verdict: Runtime Error):


class Main:

    s1, s2= int(input().split());

    if s1 <= s2:
        print("unsafe");
    else:
        print("safe");


Fixed submission:
class Main:

    s1, s2= map(int,input().split());

    if s1 <= s2:
        print("unsafe");
    else:
        print("safe");

Buggy python submission (verdict: Runtime Error):

class Main:

    s = int(input().split());

    if s[0] <= s[1]:
        print("unsafe");
    else:
        print("safe");


Fixed submission:
class Main:

    s1, s2= map(int,input().split());

    if s1 <= s2:
        print("unsafe");
    else:
        print("safe");

Buggy python submission (verdict: Runtime Error):

class Main:

    def main(s1,s2):
        if s1 <= s2:
            print("unsafe");
        else:
            print("safe");
    main()

Fixed submission:
class Main:

    s1, s2= map(int,input().split());

    if s1 <= s2:
        print("unsafe");
    else:
        print("safe");

Buggy python submission (verdict: Runtime Error):
def main():
    s = int(input.split());
    if s[1] <= s[2]:
        print("unsafe");
    else:
        print("safe");
main()

Fixed submission:
class Main:

    s1, s2= map(int,input().split());

    if s1 <= s2:
        print("unsafe");
    else:
        print("safe");
Buggy python submission (verdict: Runtime Error):
import sys;


class Main:
    s = set([i.sprit() for i in sys.stdin.readlines()]);

    print(len(s));

Fixed submission:



class Main:
    N = int(input());
    s = set([input() for i in range(N)]);
    print(len(s))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))

for i in A:
    if A[i]<A[i+1]:
        print(A.count(i))

Fixed submission:
R = int(input())

print(R*6.2828)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.insert(0,0)
             
print(A)

for i in A:
    print(A.count(i+1))
   

Fixed submission:
R = int(input())

print(R*6.2828)
Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
zeros2d = lambda r,c: [[0 for col in range(c)] for row in range(r)]

R = aint()
print(2*R*math.pi())

Fixed submission:
import sys
import math
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
zeros2d = lambda r,c: [[0 for col in range(c)] for row in range(r)]

R = aint()
print(2*R*math.pi)

Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
zeros2d = lambda r,c: [[0 for col in range(c)] for row in range(r)]

R = aint()
print(2*R*math.pi())

Fixed submission:
import sys
import math
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
zeros2d = lambda r,c: [[0 for col in range(c)] for row in range(r)]

R = aint()
print(2*R*math.pi)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
is_even = lambda x: True if x%2==0 else False
zeros2d = lambda r,c: [[0 for col in range(c)] for row in range(r)]

n = aint()
a = ints()

for i in range(n):
    print(a.count(i+1))

Fixed submission:
import sys
from collections import deque
input = lambda: sys.stdin.readline().rstrip()
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))

n = aint()
a = ints()
c = [0]*n
for i in range(n-1):
    c[a[i]-1]+=1
d = deque(c)
for i in range(n):
    print(d.popleft())
Buggy python submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip()
yes = lambda boolean: print('Yes') if boolean else print('No')
input_ints = lambda: list(map(int, input().split()))

N, M = input_ints()
A = input_ints()
A.sort(reverse=1)
yes(A[M-1]*4*M>_1)

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()
yes = lambda boolean: print('Yes') if boolean else print('No')
input_ints = lambda: list(map(int, input().split()))
 
N, M = input_ints()
A = input_ints()
A.sort(reverse=1)
yes(A[M-1]*4*M>=sum(A))
Buggy python submission (verdict: Runtime Error):
NXY = list(map(int, input().split()))
N, X, Y = NXY[0], NXY[1], NXY[2]


def flatten_2dim(array):
    return [item for sublist in array for item in sublist]


dp = []
for i in range(N):
    dp.append([])
    for j in range(N):
        if j < i:
            dp[i].append(0)
        else:
            dp[i].append(j-i)

for i in range(int(N*0.5)):
    for j in range(int(N*0.5)):
        if i == 0 and j == 0:
            dp[X-1][Y-1] = 1
        else:
            dp[X-1-i][Y-1-j] = min(1+i+j, dp[X-1-i][Y-1-j])
            dp[X-1+i][Y-1-j] = min(1+i+j, dp[X-1+i][Y-1-j])
            dp[X-1-i][Y-1+j] = min(1+i+j, dp[X-1-i][Y-1+j])
            dp[X-1+i][Y-1+j] = min(1+i+j, dp[X-1+i][Y-1+j])
print(dp)
for k in range(1, N):
    print(flatten_2dim(dp).count(k))


Fixed submission:
n,x,y = list(map(int,input().split()))
ans = [0]*(n-1)
for i in range(n-1):
    for j in range(i+1,n):
        ans[min(j-i,1+abs(x-1-i)+abs(y-1-j))-1]+=1
for num in ans:
    print(num)
Buggy python submission (verdict: Runtime Error):
K = int(input().split())
L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(L[K-1])

Fixed submission:
K = int(input())
L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(L[K-1])
Buggy python submission (verdict: Runtime Error):
ABCD = input()
A, B, C, D = int(ABCD[0]), int(ABCD[1]), int(ABCD[2]), int(ABCD[3])
oper = ['+', '-']
for op1 in range(2):
    for op2 in range(2):
        for op3 in range(2):
            sum = A + (-1)**op1*B + (-1)**op2*C + (-1)**op3*D
            if sum == 7:
                return str(A)+oper[op1]+str(B)+oper[op2]+str(C)+oper[op3]+str(D)+'=7'

Fixed submission:
ABCD = input()
A, B, C, D = int(ABCD[0]), int(ABCD[1]), int(ABCD[2]), int(ABCD[3])
oper = ['+', '-']

for op1 in range(2):
    for op2 in range(2):
        for op3 in range(2):
            sum = A + (-1)**op1*B + (-1)**op2*C + (-1)**op3*D
            if sum == 7:
                ans = str(A)+oper[op1]+str(B)+oper[op2]+str(C)+oper[op3]+str(D)+'=7'
                break
print(ans)