Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
g=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    g[a-1].append((b-1,i))

vc=[[] for _ in range(n)]
ec=[-1]*(n-1)
for p,ci in enumerate(g):
    for c, i in ci:
        color = 1
        while True:
            if color not in vc[p]:
                vc[p].append(color)
                vc[c].append(color)
                ec[i] = color
                break
            else:
                color += 1
        

print(max(ec))
for i in range(n-1):
    print(ec[i])


Fixed submission:
n=int(input())
g=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    g[a-1].append((b-1,i))

vc=[0] * n
ec=[-1]*(n-1)
for p,ci in enumerate(g):
    color = 1
    for c, i in ci:
        if vc[p] == color:
            color += 1
        vc[c] = color
        ec[i] = color
        color += 1
        

print(max(ec))
for i in range(n-1):
    print(ec[i])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
g=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    g[a-1].append((b-1,i))

vc=[[] for _ in range(n)]
ec=[-1]*(n-1)
for p,ci in enumerate(g):
    color = 1
    for c, i in ci:
        while True:
            if color not in vc[p]:
                vc[p].append(color)
                vc[c].append(color)
                ec[i] = color
                break
            else:
                color += 1
        

print(max(ec))
for i in range(n-1):
    print(ec[i])


Fixed submission:
n=int(input())
g=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    g[a-1].append((b-1,i))

vc=[0] * n
ec=[-1]*(n-1)
for p,ci in enumerate(g):
    color = 1
    for c, i in ci:
        if vc[p] == color:
            color += 1
        vc[c] = color
        ec[i] = color
        color += 1
        

print(max(ec))
for i in range(n-1):
    print(ec[i])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n, k = map(int, input().split())
a = list(map(int, input().split()))
a = np.array(a) % k
cumsum = np.cumsum(a)
cumsum = np.hstack([[0], cumsum])

count = 0
for l in range(len(cumsum)):
    for r in range(l + 1, len(cumsum)):
        s = cumsum[r] - cumsum[l]
        if r - l == s % k:
            count += 1
#             print(cumsum[r] - cumsum[l])
print(count)

Fixed submission:
from collections import defaultdict
import numpy as np
n,k=map(int,input().split())
a=[0]+list(np.cumsum(list(map(int,input().split()))))

dic = defaultdict(int)
c = 0
for i in range(len(a)):
    p = (a[i] - i) % k
    c += dic[p]
    dic[p] += 1
    if i >= k - 1:
        dic[(a[i - k + 1] - (i - k + 1)) % k] -= 1
print(c)
Buggy python submission (verdict: Runtime Error):
N, L =  list(map(int, input().split()))
r = np.arange(L, N + L)
print(np.sum(r) - r[np.argmin(np.abs(r))])

Fixed submission:
import numpy as np
N, L =  list(map(int, input().split()))
r = np.arange(L, N + L)
print(np.sum(r) - r[np.argmin(np.abs(r))])
Buggy python submission (verdict: Runtime Error):
import math

a, b, c, d =  list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

x = b//c - (a - 1)//c 

y = b//d - (a - 1)//d

cd = lcm(c, d)

z = b//cd - (a - 1)//cd

ans = b - a + 1 - x - y + z
print(ans)


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

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)
x = b//c - (a - 1)//c

y = b//d - (a - 1)//d

cd = lcm(c, d)

z = b//cd - (a - 1)//cd

ans = b - a + 1 - x - y + z
print(ans)
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

N, K = list(map(int, input().split()))


k_max = int(comb(N - 1, 2))

if k_max < K:
    print(-1)
else:
    E = [[v, N] for v in range(1, N)]

    add_need = k_max - K

    count = 0
    for i in range(1, N):
        for k in range(i + 1, N):
            E.append([i, k])
            count += 1
    #         print(count)
            if count == add_need:
                break
        if count == add_need:
            break

    print(len(E))
    for e in E:
        print(e[0], e[1])



Fixed submission:
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

N, K = list(map(int, input().split()))
k_max = int(cmb(N - 1, 2))

if N == 2:
    if K == 0:
        print(1)
        print(1, 2)
    else:
        print(-1)
elif k_max < K:
    print(-1)
else:
    E = [[v, N] for v in range(1, N)]

    add_need = k_max - K
    if add_need >= 1:
        count = 0
        for i in range(1, N):
            for k in range(i + 1, N):
                E.append([i, k])
                count += 1
        #         print(count)
                if count == add_need:
                    break
            if count == add_need:
                break

    print(len(E))
    for e in E:
        print(e[0], e[1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
R,G,B,N = list(map(int, input().split()))

s = 0
for nr in np.arange(N//R + 1):
    Nr = N - nr * R
    for ng in np.arange(Nr//G + 1):
        Nrg = Nr - ng * G
        if Nrg%B == 0:
            s += 1
print(s)

Fixed submission:
import numpy as np
from collections import Counter
R,G,B,N = list(map(int, input().split()))
a = [R, G, B]
a.sort()
a = a[::-1]
R, G, B = a

s = 0
r_cand = np.arange(0, N + 1, R)[:, None]
g_cand = np.arange(0, N + 1, G)[None, :]
rest = N - r_cand - g_cand
rest = rest[rest >= 0]
c = Counter(rest)

s = 0
for k in c.keys():
    s += (k%B == 0) * c[k]

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
def calc_f(a,b):
    if type(a) == str:
        a_bin = a
    else:
        a_bin = bin(a)[2:]
    if type(b) == str:
        b_bin = b
    else:
        b_bin = bin(b)[2:]
    
    if len(a_bin) > len(b_bin):
        b_bin = '0' * (len(a_bin) - len(b_bin)) + b_bin

    if len(b_bin) > len(a_bin):
        a_bin = '0' * (len(b_bin) - len(a_bin)) + a_bin

    s = ''
    for k in range(len(a_bin)):
        if a_bin[k] == b_bin[k]:
            s = s + '0'
        else:
            s = s + '1'
#     print(a_bin, b_bin, s)
    return s

a,b = list(map(int, input().split()))

c = bin(a)[2:]

for k in range(1, b - a + 1):
    c = calc_f(c, a + k)

ans = int(c, 2)
print(ans)

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

c = []
if a%2 == 0:
    if b%2 == 0:
        # e e 
        c = [int(((b - 1 - a + 1)/2)%2), b]
    else:
        # e o
        c = [int(((b - a + 1)/2)%2)]
else:
    if b%2 == 0:
        # o e
        c = [a, (int((b - a)/2)%2), b]
    else:
        # o o
        c = [a, int(((b + 1 - a)/2)%2)]

d = 0
for cc in c:
#     print(c)
    d += int(bin(cc)[2:])
    d = str(d)
    d = d.replace('2', '0')
    d = int(d)
    
print(int(str(d), 2))
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
h = list(map(int, input().split()))

h = np.array(h)

h_zero = np.hstack([np.zeros(1), h, np.zeros(1)])

d = np.diff(h_zero)

a= (d[:-1] * d[1:]) < 0

h_a = h[a == True]

s = 0
for k in range(len(h_a)):
    
    if k%2 == 0:
        
            
        if k == 0:
            s += h_a[k] - h_a[k+1]
        elif k == len(h_a)-1:
            s += h_a[k] - h_a[k-1] 
        else:
            s += h_a[k] - np.max([h_a[k-1], h_a[k+1]])
    else:
        s += h_a[k]
#     print(k, s)
print(s)

Fixed submission:
import numpy as np
n = int(input())
h = list(map(int, input().split()))

h = np.array(h)


def calc(h, s):
#     print(h, s)
    a = np.min(h)
    s += a
    h = h - a
    ind = np.where(h == 0)[0][0]
    h1 = h[:ind]
    h2 = h[ind+1:]
    if len(h1) != 0:
        s = calc(h1, s)
    if len(h2) != 0:
        s = calc(h2, s)
    return s

print(calc(h, 0))

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

h = np.array(h)

h_zero = np.hstack([np.zeros(1), h, np.zeros(1)])

d = np.diff(h_zero)

a= (d[:-1] * d[1:]) < 0

h_a = h[a == True]

s = 0
for k in range(len(h_a)):
    
    if k%2 == 0:
        
            
        if k == 0:
            s += h_a[k] - h_a[k+1]
        elif k == len(h_a)-1:
            s += h_a[k] - h_a[k-1] 
        else:
            s += h_a[k] - np.max([h_a[k-1], h_a[k+1]])
    else:
        s += h_a[k]
#     print(k, s)
print(s)

Fixed submission:
import numpy as np
n = int(input())
h = list(map(int, input().split()))

h = np.array(h)


def calc(h, s):
#     print(h, s)
    a = np.min(h)
    s += a
    h = h - a
    ind = np.where(h == 0)[0][0]
    h1 = h[:ind]
    h2 = h[ind+1:]
    if len(h1) != 0:
        s = calc(h1, s)
    if len(h2) != 0:
        s = calc(h2, s)
    return s

print(calc(h, 0))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a = np.array(a)
b = np.array(b)

if np.sum(a) < np.sum(b):
    ans = -1
else:
    diff = a - b
    diff_ori = np.copy(diff)
    dames= np.where(diff < 0)[0]
    for d in dames:
        yoyuu = np.argmax(diff)
        diff[yoyuu] += diff[d]
        diff[d] -= diff[d]
    ans = len(diff) - np.sum(diff_ori == diff)
print(ans)

Fixed submission:
import numpy as np

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))


a = np.array(a)
b = np.array(b)


if np.sum(a) < np.sum(b):
    ans = -1
else:

    diff = a - b
    diff = np.sort(diff)
    if np.sum(diff<0) == 0:
        ans = 0
    else:
        for ind in range(len(diff)):
            if diff[ind] > 0:
                break

        minus = np.sum(diff[:ind])
        minus_num = ind

        yoyuu = diff[ind:][::-1]

        for ind in range(len(yoyuu)):
            minus += yoyuu[ind]
            if minus > 0:
                ans = minus_num + ind + 1
                break
            if minus == 0:
                ans = minus_num + ind
                break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K = list(map(int,input().split()))
a = list(map(int,input().split()))

a = np.array(a)

s = 0
e = 0

arr = []
for s in range(N):
    for e in range(s+1, N+1):
        arr.append(a[s:e])

max_len = len(bin(np.sum(a))[2:])

su = 0
b = [bin(np.sum(aa))[2:] for aa in arr]
b = ['0' * (max_len - len(bb)) + bb for bb in b]
while True:
    c = [bb for bb in b if bb[0] == '1']
    if len(c) >= K:
        su += 2 ** (len(c[0]) - 1)
        b = [cc[1:] for cc in c]
    else:
        b = [bb[1:] for bb in b]
    if len(b[0]) == 0:
        break
print(su)

Fixed submission:
import numpy as np
N, K = list(map(int,input().split()))
a = list(map(int,input().split()))

a = np.array(a)

s = 0
e = 0

arr = []
aa = np.append(0,np.cumsum(a))
for s in range(len(aa)):
    for e in range(s+1, len(aa)):
        arr.append(aa[e] - aa[s])

max_len = len(bin(np.sum(a))[2:])

su = 0
b = [bin(aa)[2:] for aa in arr]
b = ['0' * (max_len - len(bb)) + bb for bb in b]
while True:
    c = [bb for bb in b if bb[0] == '1']
    if len(c) >= K:
        su += 2 ** (len(c[0]) - 1)
        b = [cc[1:] for cc in c]
    else:
        b = [bb[1:] for bb in b]
    if len(b[0]) == 0:
        break
print(su)

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
a = list(map(int,input().split()))

a = np.array(a)

s = 0
e = 0

arr = []
for s in range(N):
    for e in range(s+1, N+1):
        arr.append(a[s:e])

max_len = len(bin(np.sum(a))[2:])

su = 0
b = [bin(np.sum(aa))[2:] for aa in arr]
b = ['0' * (max_len - len(bb)) + bb for bb in b]
while True:
    c = [bb for bb in b if bb[0] == '1']
    if len(c) >= K:
        su += 2 ** (len(c[0]) - 1)
        b = [cc[1:] for cc in c]
    else:
        b = [bb[1:] for bb in b]
    if len(b[0]) == 0:
        break
print(su)

Fixed submission:
import numpy as np
N, K = list(map(int,input().split()))
a = list(map(int,input().split()))

a = np.array(a)

s = 0
e = 0

arr = []
aa = np.append(0,np.cumsum(a))
for s in range(len(aa)):
    for e in range(s+1, len(aa)):
        arr.append(aa[e] - aa[s])

max_len = len(bin(np.sum(a))[2:])

su = 0
b = [bin(aa)[2:] for aa in arr]
b = ['0' * (max_len - len(bb)) + bb for bb in b]
while True:
    c = [bb for bb in b if bb[0] == '1']
    if len(c) >= K:
        su += 2 ** (len(c[0]) - 1)
        b = [cc[1:] for cc in c]
    else:
        b = [bb[1:] for bb in b]
    if len(b[0]) == 0:
        break
print(su)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

n,m = list(map(int, input().split()))
s = input()
t = input()

s1 = ''
for ss in s:
    s1 += ss
    s1 += 'A'*(m-1)

t1 = ''
for tt in t:
    t1 += tt
    t1 += 'A'*(n-1)

ok = 1
for k in range(len(s1)):
    if s1[k] != 'A' and t1[k] != 'A':
        if s1[k] != t1[k]:
            ok = -1
        if ok == -1:
            break
if ok == 1:
    print(int(m * n / gcd(m,n)))
else:
    print('-1')

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

n,m = list(map(int, input().split()))
s = input()
t = input()

sdic = {}
for k in range(0, len(s)):
    sdic[k*m] = s[k]
tdic = {}
for k in range(0, len(t)):
    tdic[k*n] = t[k]
ok = 1
for skey in sdic.keys():
    try:
        if tdic[skey] != sdic[skey]:
            ok = -1
    except:
        pass
    
if ok == 1:
    print(int(m * n / gcd(m,n)))
else:
    print('-1')

Buggy python submission (verdict: Runtime Error):
import math
n,m = list(map(int, input().split()))
s = input()
t = input()

s1 = ''
for ss in s:
    s1 += ss
    s1 += 'A'*(m-1)

t1 = ''
for tt in t:
    t1 += tt
    t1 += 'A'*(n-1)

ok = 1
for k in range(len(s1)):
    if s1[k] != 'A' and t1[k] != 'A':
        if s1[k] != t1[k]:
            ok = -1
        if ok == -1:
            break
if ok == 1:
    print(int(m * n / math.gcd(m,n)))
else:
    print('-1')

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

n,m = list(map(int, input().split()))
s = input()
t = input()

sdic = {}
for k in range(0, len(s)):
    sdic[k*m] = s[k]
tdic = {}
for k in range(0, len(t)):
    tdic[k*n] = t[k]
ok = 1
for skey in sdic.keys():
    try:
        if tdic[skey] != sdic[skey]:
            ok = -1
    except:
        pass
    
if ok == 1:
    print(int(m * n / gcd(m,n)))
else:
    print('-1')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
v = list(map(int,input().split()))

v = np.array(v)

if len(np.unique(v)) == 1:
    print(int(len(v)/2))
else:
    vodd = v[np.arange(0,len(v),2)]
    vodd_unique = np.unique(vodd)
    d_odd = []
    odd_lis = []
    for vu in vodd_unique:
        d_odd.append(sum(vodd == vu))
        odd_lis.append(vu)

    veven = v[np.arange(1,len(v),2)]
    veven_unique = np.unique(veven)
    d_even = []
    even_lis = []
    for vu in veven_unique:
        d_even.append(sum(veven == vu))
        even_lis.append(vu)

    if even_lis[np.argmax(d_even)] != odd_lis[np.argmax(d_odd)]:
        score = np.max(d_even) + np.max(d_odd)
    else:
        score1 = even_lis[np.argsort(d_even)[-1]] + odd_lis[np.argsort(d_odd)[-2]]
        score2 = even_lis[np.argsort(d_even)[-2]] + odd_lis[np.argsort(d_odd)[-1]]
        score = max(score1,score2)
    print(len(v) - score)

Fixed submission:
from collections import Counter
import numpy as np
n = int(input())
v = list(map(int,input().split()))

# v = [1, 1] * 5
# v += [2, 2] * 4
v = np.array(v)

if len(np.unique(v)) == 1:
    print(int(len(v)/2))
else:
    vodd = v[np.arange(0,len(v),2)]
    odd_count = Counter(vodd)

    veven = v[np.arange(1,len(v),2)]
    even_count = Counter(veven)
    

    d_odd = []
    odd_lis = list(odd_count.keys())
    for key in odd_count.keys():
        d_odd.append(odd_count[key])

    d_even = []
    even_lis = list(even_count.keys())
    for key in even_count.keys():
        d_even.append(even_count[key])

    
    if even_lis[np.argmax(d_even)] != odd_lis[np.argmax(d_odd)]:
        score = np.max(d_even) + np.max(d_odd)
    else:
#         print('a')
        score1 = d_even[np.argsort(d_even)[-1]] + d_odd[np.argsort(d_odd)[-2]]
        score2 = d_even[np.argsort(d_even)[-2]] + d_odd[np.argsort(d_odd)[-1]]
        score = max(score1,score2)
    print(len(v) - score)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))

print(np.max(a) * 9 + np.sum(a))

Fixed submission:
import numpy as np

a = list(map(int,input().split()))
print(np.max(a) * 9 + np.sum(a))
Buggy python submission (verdict: Runtime Error):
n,m,X,Y = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))

x.append(X)
y.append(Y)

if np.max(x) < np.min(y):
    print('No War')
else:
    print('War')

Fixed submission:
import numpy as np


n,m,X,Y = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))

x.append(X)
y.append(Y)

if np.max(x) < np.min(y):
    print('No War')
else:
    print('War')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = list(map(int,input().split()))

import numpy as np
# t = time.time()
ans = 0
mut_ori = n//k
for a in range(1, k + 1):
    b_cand = list(range(k - a%k,n+1,k))
    for b in b_cand:
        c_cand = list(range(k - b%k,n+1,k))
        for c in c_cand:
            if a <= n%k:
                mut = mut_ori + 1
            else:
                mut = mut_ori
            if (a + c) % k == 0:
                ans += mut
#             print(a,b,c,mut)
print(ans)
# print(time.time() - t)

Fixed submission:
import numpy as np
n, k = list(map(int,input().split()))

ans = 0
mut_ori = n//k
for a in range(1, k + 1):
    b_cand = list(range(k - a%k,k+1,k))
    for b in b_cand:
        c_cand = list(range(k - b%k,n+1,k))
        for c in c_cand:
            if a <= n%k:
                mut = mut_ori + 1
            else:
                mut = mut_ori
            if b <= n%k:
                mut *= (mut_ori + 1)
            else:
                mut *= mut
            if (a + c) % k == 0:
                ans += mut
#             print(a,b,c,mut)
print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a * b - a - b + 1)

Fixed submission:
a,b = list(map(int,input().split()))
print(a * b - a - b + 1)
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

x = 0
ans1 = []
while True:
    if s[x] == '1':
        ans1.append(x+1)
        x += 1
    else:
        break

if k in ans1:
    print('1')
else:
    print(s[x])

Fixed submission:
s = input()
k = int(input())

x = 0
ans1 = []
for x in range(len(s)):
    if s[x] == '1':
        ans1.append(x+1)
        x += 1
    else:
        break

if k in ans1:
    print('1')
else:
    print(s[x])
Buggy python submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
if n%k == 0:
    pirnt(0)
else:
    print(1)

Fixed submission:
n,k = list(map(int,input().split()))
if n%k == 0:
    print(0)
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M = map(int,input().split())

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.stack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))

Fixed submission:
import numpy as np
N,M = map(int,input().split())

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.vstack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.stack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))

Fixed submission:
import numpy as np
N,M = map(int,input().split())

x = []
y = []
z = []
for k in range(N):
    xx,yy,zz = map(int,input().split())
    x.append(xx)
    y.append(yy)
    z.append(zz)

ite = [-1,1]

s_ori = np.vstack([x,y,z])
cc = []
for i in ite:
    for j in ite:
        for k in ite:
            s = s_ori.copy()
            s[0,:] *= i
            s[1,:] *= j
            s[2,:] *= k
            a = np.sum(s,axis = 0)
            b = np.sort(a)[::-1][:M]
            c = sum(b)
            cc.append(c)
print(np.max(cc))
Buggy python submission (verdict: Runtime Error):
X = input()

if 400 <= X <= 599:
    print(8)
if 600 <= X <= 799:
    print(7)
if 800 <= X <= 999:
    print(6)
if 1000 <= X <= 1199:
    print(5)
if 1200 <= X <= 1399:
    print(4)
if 1400 <= X <= 1599:
    print(3)
if 1600 <= X <= 1799:
    print(2)
if 1800 <= X <= 1999:
    print(1)

Fixed submission:
X = int(input())

if 400 <= X <= 599:
    print(8)
if 600 <= X <= 799:
    print(7)
if 800 <= X <= 999:
    print(6)
if 1000 <= X <= 1199:
    print(5)
if 1200 <= X <= 1399:
    print(4)
if 1400 <= X <= 1599:
    print(3)
if 1600 <= X <= 1799:
    print(2)
if 1800 <= X <= 1999:
    print(1)

Buggy python submission (verdict: Runtime Error):
if 400 <= X <= 599:
    print(8)
if 600 <= X <= 799:
    print(7)
if 800 <= X <= 999:
    print(6)
if 1000 <= X <= 1199:
    print(5)
if 1200 <= X <= 1399:
    print(4)
if 1400 <= X <= 1599:
    print(3)
if 1600 <= X <= 1799:
    print(2)
if 1800 <= X <= 1999:
    print(1)

Fixed submission:
X = int(input())

if 400 <= X <= 599:
    print(8)
if 600 <= X <= 799:
    print(7)
if 800 <= X <= 999:
    print(6)
if 1000 <= X <= 1199:
    print(5)
if 1200 <= X <= 1399:
    print(4)
if 1400 <= X <= 1599:
    print(3)
if 1600 <= X <= 1799:
    print(2)
if 1800 <= X <= 1999:
    print(1)