Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
arr = list(map(int, input().split()))

# n, k = 4, 5
# arr = list(map(int, "10 1 2 22".split()))

add = sum(arr)

def check(factor):
	mod_factor = [x%factor for x in arr]
	left, right = 0, n-1
	reqd, rem = 0, 0
	mod_factor.sort()
	counter = 0
	while left <= right:
		reqd = factor - mod_factor[right]
		while mod_factor[right]% factor != 0:
			if reqd < mod_factor[left]:
				mod_factor[left] -= reqd
				mod_factor[right] = 0
				counter += reqd
			else:
				mod_factor[right] -= mod_factor[left]
				reqd -= mod_factor[left]
				counter += mod_factor[left]
				left += 1
		right -= 1
	return countera <= k

ans = i = 1
while i*i <= add:
	if add % i == 0:
		if check(i):
			ans = max(ans, i)
		if check(add//i):
			ans = max(ans, add//i)
	i += 1
print(ans)

Fixed submission:
n, k = map(int, input().split())
arr = list(map(int, input().split()))

# n, k = 8, 7
# arr = list(map(int, "1 7 5 6 8 2 6 5".split()))

add = sum(arr)

def check(factor):
	mod_factor = [x%factor for x in arr]
	mod_factor.sort(reverse = True)
	p = sum(mod_factor)//factor
	# print('p: ', p, 'factor:',factor, 'sum: ', sum(mod_factor))
	# print('mod_factor: ', mod_factor)
	# print(mod_factor[:p])
	c = sum(factor - mod_factor[i] for i in range(p))
	return c <= k

ans = i = 1
while i*i <= add:
	if add % i == 0:
		if check(i):
			ans = max(ans, i)
		if check(add//i):
			ans = max(ans, add//i)
	i += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
# n = 5

arr = [0]*n
suffix_arr = [0]*(n+1)
# arr = [0, 2, 0, 4, 2]
for i in range(n):
	arr[i] = int(input())

conditional_flag = True

for i in range(1, n+1):
	for j in range(i, n+1, i):
		suffix_arr[i] += arr[j-1]
	if suffix_arr[i]%2 != arr[i-1]%2:
		conditional_flag = False
		break

if conditional_flag:
	b = [i+1 for i in range(i) if arr[i]]
	length = len(b)
	print(length)
	if length: print(*b)
else:
	print(-1)

Fixed submission:
n = int(input())

a = list(map(int, input().split()))
box = [0]*n
for i in range(n,0,-1):
    sum_box = 0
    for j in range(i,n+1,i):
        sum_box+=box[j-1]
    if sum_box%2!=a[i-1]:
        box[i-1]+=1
 
print(sum(box))
if sum(box):
    ans = []
    for i, x in enumerate(box):
        if x:
            ans.append(i+1)
    print(*ans)

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

n = int(input())
# n = 3

arr = [0]*n

pq = []
for i in range(n):
	arr[i] = int(input())
	heapq.heappush(pq, (-arr[i], i))
heapq.heapify(pq)
lg = heapq.heappop(pq)
slg = heapq.heappop(pq)
print(lg, slg)
lg, slg = lg[1], slg[1]

for i in range(n):
	if i==lg:
		print(arr[slg])
	else:
		print(arr[lg])

Fixed submission:
n = int(input())

a = list(map(int, input().split()))
box = [0]*n
for i in range(n,0,-1):
    sum_box = 0
    for j in range(i,n+1,i):
        sum_box+=box[j-1]
    if sum_box%2!=a[i-1]:
        box[i-1]+=1
 
print(sum(box))
if sum(box):
    ans = []
    for i, x in enumerate(box):
        if x:
            ans.append(i+1)
    print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

arr = [0]*n
arr[0] = int(input())
color= [arr[0]]

for i in range(1, n):
	arr[i] = int(input())
	if arr[i] > color[-1]:
		color[-1] = arr[i]
	else:
		maxx = -1
		for idx, c in enumerate(color):
			if c < arr[i] and c > maxx:
				iidx = idx
				maxx = c
		if maxx != -1:
			color[iidx] = arr[i]
		else:
			color.append(arr[i])
print(len(color))

Fixed submission:
from bisect import bisect

n = int(input())

seq = []
for i in range(n):
	ele = int(input())
	pos = bisect(seq, -ele)
	if len(seq) <= pos:
		seq.append(-ele)
	else:
		seq[pos] = -ele

print(len(seq))
Buggy python submission (verdict: Runtime Error):
mod = pow(10, 9)+7

n, k = map(int, input().split())
blues = k
reds = n-k

C = [[0]*2000 for i in range(2000)]

def preprocess():
	global C

	for i in range(2000):
		for j in range(i+1):
			if i==j or j==0:
				C[i][j] = 1
			else:
				C[i][j] = (C[i-1][j-1] + C[i-1][j])%mod
preprocess()

for i in range(k):
	slots = reds + 1
	res = (C[slots][i+1]*C[k-1][i])%mod
	print(res)


Fixed submission:
n, k = map(int, input().split())
reds = n-k
blues = k

mod = pow(10, 9) + 7

maxn = 2000
C = [[0]*(maxn+1) for i in range(maxn+1)]

def preprocess():
	global C
	for i in range(maxn+1):
		for j in range(i+1):
			if i == 0 or j== i :
				C[i][j] = 1
			else:
				C[i][j] = (C[i-1][j-1] + C[i-1][j])%mod
preprocess()


for i in range(k):
	slots = reds + 1
	res = (C[slots][i+1]*C[blues - 1][i])%mod
	print(res)
Buggy python submission (verdict: Runtime Error):
import math
import sys

l, r, c, d = map(int, sys.stdin.readline().split())

count = 0

first = (l + c - 1)//c 
last = r//c 

count += last - first + 1

first = (l + d - 1)//d 
last = r//d 
count += last - first + 1

lcm = c*d//math.gcd(c, d)

first = (l + lcm - 1)//lcm 
last = r // lcm
count -= last - first + 1


print(r - l - count + 1)

Fixed submission:
from fractions import gcd 
import sys

l, r, c, d = map(int, sys.stdin.readline().split())

count = 0

first = (l + c - 1)//c 
last = r//c 

count += last - first + 1

first = (l + d - 1)//d 
last = r//d 
count += last - first + 1

lcm = c*d//gcd(c, d)

first = (l + lcm - 1)//lcm 
last = r // lcm
count -= last - first + 1


print(r - l - count + 1)

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

l, r, c, d = map(int, input().split())
# numbers = [True]*(r+1)


count = 0

first = (l + c - 1)//c 
last = r//c 

count += last - first + 1

first = (l + d - 1)//d 
last = r//d 
count += last - first + 1

lcm = c*d//math.gcd(c, d)

first = (l + lcm - 1)//lcm 
last = r // lcm
count -= last - first + 1


print(r - l - count + 1)

Fixed submission:
from fractions import gcd 
import sys

l, r, c, d = map(int, sys.stdin.readline().split())

count = 0

first = (l + c - 1)//c 
last = r//c 

count += last - first + 1

first = (l + d - 1)//d 
last = r//d 
count += last - first + 1

lcm = c*d//gcd(c, d)

first = (l + lcm - 1)//lcm 
last = r // lcm
count -= last - first + 1


print(r - l - count + 1)

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

l, r, c, d = map(int, input().split())
# numbers = [True]*(r+1)


count = 0

first = (l + c - 1)//c 
last = r//c 

count += last - first + 1

first = (l + d - 1)//d 
last = r//d 
count += last - first + 1

lcm = c*d//math.gcd(c, d)

first = (l + lcm - 1)//lcm 
last = r // lcm
count -= last - first + 1


print(r - l - count + 1)

Fixed submission:
from fractions import gcd 
import sys

l, r, c, d = map(int, sys.stdin.readline().split())

count = 0

first = (l + c - 1)//c 
last = r//c 

count += last - first + 1

first = (l + d - 1)//d 
last = r//d 
count += last - first + 1

lcm = c*d//gcd(c, d)

first = (l + lcm - 1)//lcm 
last = r // lcm
count -= last - first + 1


print(r - l - count + 1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = [0]*n

for i in range(n):
	city, score = input().split()
    arr[i] = [city, int(score), i+1]
arr.sort(key = lambda x: (x[0], -x[1]))
for ele in arr:
  print(arr[2])

Fixed submission:
n = int(input())

arr= [0]*n

for i in range(n):
	city, score = input().split()
	arr[i] = [city, int(score), i+1]

arr.sort(key = lambda x:(x[0],-x[1]))

for ele in arr:
	print(ele[2])
Buggy python submission (verdict: Runtime Error):
def p_d():
    import math
    from functools import reduce
    n, m = map(int, input().split())
    *A, = map(lambda x: int(x) // 2, input().split())

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

    def lcm_list(numbers):
        return reduce(lcm_base, numbers, 1)

    lcm = lcm_list(A)
    print((m // lcm + 1) // 2)
    
p_d()

Fixed submission:
def p_d():
    from fractions import gcd
    n, m = map(int, input().split())
    *A, = map(lambda x: int(x) // 2, input().split())

    c = 0
    for a in A:
        if c == 0:
            while a & 1 == 0:
                c += 1
                a >>= 1
        else:
            ne = 0
            while a & 1 == 0:
                ne += 1
                a >>= 1
            if c != ne:
                print(0)
                exit()

    lcm = A[0]
    for i in range(1, n):
        lcm = lcm * A[i] // gcd(lcm, A[i])
    print((m // lcm + 1) // 2)
    
p_d()
Buggy python submission (verdict: Time Limit Exceeded):
def p_f():
    from sys import stdin
    input = stdin.readline
    N, u, v = map(int, input().split())
    edges = [list(map(int, input().split())) for i in range(N - 1)]
    if u == v:
        print(0)
        exit()

    def BFS(K, edges, N):
        roots = [[] for i in range(N)]
        for a, b in edges:
            roots[a - 1] += [(b - 1, 1)]
            roots[b - 1] += [(a - 1, 1)]
        dist = [-1] * N
        stack = []
        stack.append(K)
        dist[K] = 0
        while stack:
            label = stack.pop(-1)
            for i, c in roots[label]:
                if dist[i] == -1:
                    dist[i] = dist[label] + c
                    stack += [i]
        return dist

    dist_v = BFS(v - 1, edges, N)
    dist_u = BFS(u - 1, edges, N)
    # print(dist_v)
    # print(dist_u)
    maxIndex = [i for i, x in enumerate(dist_v) if x == max(dist_v)]
    for i in maxIndex:
        if max(dist_v) > dist_u[i]:
            print(max(dist_v) - 1)
            exit()
    if dist_v[u - 1] > max(dist_v) - dist_v[u - 1]:
        print(max(dist_v) - 1)
    else:
        print(dist_v[u - 1] - 1)


if __name__ == '__main__':
    p_f()


Fixed submission:
def p_f():
    from sys import stdin
    input = stdin.readline
    N, u, v = map(int, input().split())
    edges = [list(map(int, input().split())) for i in range(N - 1)]
    if u == v:
        print(0)
        exit()

    def BFS(K, edges, N):
        roots = [[] for i in range(N)]
        for a, b in edges:
            roots[a - 1] += [(b - 1, 1)]
            roots[b - 1] += [(a - 1, 1)]
        dist = [-1] * N
        stack = []
        stack.append(K)
        dist[K] = 0
        while stack:
            label = stack.pop(-1)
            for i, c in roots[label]:
                if dist[i] == -1:
                    dist[i] = dist[label] + c
                    stack += [i]
        return dist

    dist_v = BFS(v - 1, edges, N)
    dist_u = BFS(u - 1, edges, N)
    ans = 0
    for du, dv in zip(dist_u, dist_v):
        if du < dv and ans < dv - 1:
            ans = dv - 1
    print(ans)


if __name__ == '__main__':
    p_f()
Buggy python submission (verdict: Runtime Error):
def p_d():
    from scipy.special import comb
    x, y = map(int, input().split())
    mod = 10 ** 9 + 7
    if y > x:
        x, y = y, x
    if (x + y) % 3 != 0:
        print(0)
        exit()
    if x - y > (x + y) // 3:
        print(0)
        exit()
    x, y = x - (x + y) // 3, y - (x + y) // 3
    print(comb(x + y, y, exact=True) % mod)
    
p_d()

Fixed submission:
def p_d():
    x, y = map(int, input().split())
    if y > x:
        x, y = y, x
    if (x + y) % 3 != 0:
        print(0)
        exit()
    if x - y > (x + y) // 3:
        print(0)
        exit()
    x, y = x - (x + y) // 3, y - (x + y) // 3

    mod = 10 ** 9 + 7  # 出力の制限
    N = x + y
    g1 = [1, 1]  # 元テーブル
    g2 = [1, 1]  # 逆元テーブル
    inverse = [0, 1]  # 逆元テーブル計算用テーブル

    for i in range(2, N + 1):
        g1.append((g1[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod // i)) % mod)
        g2.append((g2[-1] * inverse[-1]) % mod)

    def cmb(n, r, mod):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return g1[n] * g2[r] * g2[n - r] % mod

    print(cmb(x + y, y, mod))
    
p_d()

Buggy python submission (verdict: Runtime Error):
def p_d():
    from scipy.special import comb
    x, y = map(int, input().split())
    mod = 10 ** 9 + 7
    if y > x:
        x, y = y, x
    if (x + y) % 3 != 0:
        print(0)
        exit()
    if x - y > (x + y) // 3:
        print(0)
        exit()
    x, y = x - (x + y) // 3, y - (x + y) // 3
    print(comb(x + y, y, exact=True) % mod)
    
p_d()

Fixed submission:
def p_d():
    x, y = map(int, input().split())
    if y > x:
        x, y = y, x
    if (x + y) % 3 != 0:
        print(0)
        exit()
    if x - y > (x + y) // 3:
        print(0)
        exit()
    x, y = x - (x + y) // 3, y - (x + y) // 3

    mod = 10 ** 9 + 7  # 出力の制限
    N = x + y
    g1 = [1, 1]  # 元テーブル
    g2 = [1, 1]  # 逆元テーブル
    inverse = [0, 1]  # 逆元テーブル計算用テーブル

    for i in range(2, N + 1):
        g1.append((g1[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod // i)) % mod)
        g2.append((g2[-1] * inverse[-1]) % mod)

    def cmb(n, r, mod):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return g1[n] * g2[r] * g2[n - r] % mod

    print(cmb(x + y, y, mod))
    
p_d()
Buggy python submission (verdict: Runtime Error):
from sys import stdin

input = stdin.readline


def p_a():
    n = int(input())
    print(((n + 1) // 2) / n)


def p_b():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))

    print(sum(map(lambda x: x >= k)))


if __name__ == '__main__':
    p_b()


Fixed submission:
from sys import stdin

input = stdin.readline


def p_a():
    n = int(input())
    print(((n + 1) // 2) / n)


def p_b():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))

    print(sum(map(lambda x: x >= k, h)))


if __name__ == '__main__':
    p_b()
Buggy python submission (verdict: Runtime Error):
def p_a():
    H, W, A, B = map(int, input().split())

    if H % A != 0 or W % B != 0:

        if H < A * 2 or W < B * 2:
            print("No")
            exit()

        if H > A * 3 or W > B * 3:
            print("No")
            exit()

    S = [[0] * W for _ in range(H)]

    for i in range(H):
        for j in range(W):
            if j // B == 1 and i // A == 1:
                S[i][j] = 1

            if j // B == 1:
                continue

            if i // A == 1:
                continue

            S[i][j] = 1

    for i in range(H):
        print(*S[i], sep="")


if __name__ == '__main__':
    p_a()


Fixed submission:
def p_a():
    H, W, A, B = map(int, input().split())

    S = [[0] * W for _ in range(H)]

    if A == 0 and B == 0:
        for i in range(H):
            print(*S[i], sep="")
        exit()

    for i in range(H):
        for j in range(W):
            if A == 0:
                if i < B:
                    S[i][j] = 1
                continue
            elif B == 0:
                if j < A:
                    S[i][j] = 1
                continue

            if i // B == 1 and j // A == 1:
                S[i][j] = 1

            if i // B == 1:
                continue

            if j // A == 1:
                continue

            S[i][j] = 1

    for i in range(H):
        print(*S[i], sep="")


if __name__ == '__main__':
    p_a()
Buggy python submission (verdict: Time Limit Exceeded):
def p_c():
    N, K, Q = map(int, input().split())

    l = [K] * N

    for _ in range(Q):
        A = int(input())
        for i in range(N):
            if i == A - 1:
                continue
            l[i] -= 1

    for a in l:
        if a > 0:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    p_c()


Fixed submission:
from collections import defaultdict


def p_c():
    N, K, Q = map(int, input().split())

    l = defaultdict(int)

    for _ in range(Q):
        A = int(input())
        l[A - 1] += 1

    for i in range(N):
        if K - Q + l[i] > 0:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    p_c()
Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_left
from math import floor


def p_d():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()

    for _ in range(M):
        x = A.pop() / 2

        i = bisect_left(A, x)

        A.insert(i, x)

    ans = 0

    for a in A:
        ans += floor(a)

    print(ans)


if __name__ == '__main__':
    p_d()


Fixed submission:
from heapq import heappop, heappush
from math import ceil, floor


def p_d():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    H = []

    for a in A:
        heappush(H, a * -1)

    for _ in range(M):
        x = heappop(H)

        heappush(H, ceil(x / 2))

    ans = 0

    for a in H:
        ans -= a

    print(ans)


if __name__ == '__main__':
    p_d()
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(N * (N - 1)//2)

Fixed submission:
def p_a():
    S = input()
    T = input()

    ans = 0

    for s,t in zip(list(S), list(T)):
        if s == t:
            ans += 1

    print(ans)


if __name__ == '__main__':
    p_a()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict


def p_d_r(ans, l, R, x):
    for i in R:
        ans[i - 1] += x
        p_d_r(ans, l, l[i], x)


def p_d():
    N, Q = map(int, input().split())
    l = defaultdict(list)
    ans = [0] * N

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

    for _ in range(Q):
        p, x = map(int, input().split())
        ans[p - 1] += x
        p_d_r(ans, l, l[p], x)

    print(*ans)


if __name__ == '__main__':
    p_d()


Fixed submission:
from collections import defaultdict


def p_d():
    N, Q = map(int, input().split())
    l = defaultdict(list)
    ans = [0] * N

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

    for _ in range(Q):
        p, x = map(int, input().split())
        ans[p - 1] += x

    for i in range(N):
        for j in l[i]:
            ans[j - 1] += ans[i - 1]

    print(*ans)


if __name__ == '__main__':
    p_d()
Buggy python submission (verdict: Time Limit Exceeded):
def p_d():
    S = input()
    N = 13

    dp = [0] * N
    dp[0] = 1

    mul = 1
    mod = 10 ** 9 + 7

    for i in reversed(range(len(S))):
        nextDP = [0] * N
        c = S[i]
        if c == "?":
            for k in range(10):  # 数字[0-9]
                for j in range(N):
                    nextDP[(k * mul + j) % N] += dp[j]
                    nextDP[(k * mul + j) % N] %= mod
        else:
            k = int(c)
            for j in range(N):
                nextDP[(k * mul + j) % N] += dp[j]
                nextDP[(k * mul + j) % N] %= mod
        mul *= 10
        mul %= N
        dp = nextDP

    print(int(dp[5]))


if __name__ == '__main__':
    p_d()


Fixed submission:
def p_d():
    S = input()
    N = 13

    dp = [0] * N
    dp[0] = 1

    mul = 1
    mod = 10 ** 9 + 7

    for i in reversed(range(len(S))):
        nextDP = [0] * N
        c = S[i]
        if c == "?":
            for k in range(10):  # 数字[0-9]
                for j in range(N):
                    nextDP[(k * mul + j) % N] += dp[j]
                    nextDP[(k * mul + j) % N] %= mod
        else:
            k = int(c)
            for j in range(N):
                nextDP[(k * mul + j) % N] += dp[j]
                nextDP[(k * mul + j) % N] %= mod
        mul *= 10
        mul %= N
        dp = nextDP

    print(int(dp[5]))


if __name__ == '__main__':
    p_d()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np


def p_d():
    S = input()
    N = 13

    dp = np.zeros(N)
    dp[0] = 1

    mul = 1
    mod = 10 ** 9 + 7

    for i in reversed(range(len(S))):
        nextDP = np.zeros(N)
        c = S[i]
        if c == "?":
            for k in range(10):  # 数字[0-9]
                for j in range(N):
                    nextDP[(k * mul + j) % N] += dp[j]
                    nextDP[(k * mul + j) % N] %= mod
        else:
            k = int(c)
            for j in range(N):
                nextDP[(k * mul + j) % N] += dp[j]
                nextDP[(k * mul + j) % N] %= mod
        mul *= 10
        mul %= N
        dp = nextDP

    print(int(dp[5]))


if __name__ == '__main__':
    p_d()


Fixed submission:
def p_d():
    S = input()
    N = 13

    dp = [0] * N
    dp[0] = 1

    mul = 1
    mod = 10 ** 9 + 7

    for i in reversed(range(len(S))):
        nextDP = [0] * N
        c = S[i]
        if c == "?":
            for k in range(10):  # 数字[0-9]
                for j in range(N):
                    nextDP[(k * mul + j) % N] += dp[j]
                    nextDP[(k * mul + j) % N] %= mod
        else:
            k = int(c)
            for j in range(N):
                nextDP[(k * mul + j) % N] += dp[j]
                nextDP[(k * mul + j) % N] %= mod
        mul *= 10
        mul %= N
        dp = nextDP

    print(int(dp[5]))


if __name__ == '__main__':
    p_d()
Buggy python submission (verdict: Runtime Error):
def p_c():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    m = max(A)
    a = A.index(m)
    A.pop(a)
    b = max(A)

    for i in range(N):
        if i == a:
            print(b)
        else:
            print(m)


if __name__ == '__main__':
    p_b()


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

    m = max(A)
    a = A.index(m)
    A.pop(a)
    b = max(A)

    for i in range(N):
        if i == a:
            print(b)
        else:
            print(m)


if __name__ == '__main__':
    p_c()

Buggy python submission (verdict: Time Limit Exceeded):
def p_c():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    for i in range(N):
        a = A.copy()
        a.pop(i)
        print(max(a))


if __name__ == '__main__':
    p_c()

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

    m = max(A)
    a = A.index(m)
    A.pop(a)
    b = max(A)

    for i in range(N):
        if i == a:
            print(b)
        else:
            print(m)


if __name__ == '__main__':
    p_c()

Buggy python submission (verdict: Runtime Error):
def p_c():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    for i in range(N):
        a = A.copy()
        a.pop(i)
        print(max(a))


if __name__ == '__main__':
    p_b()

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

    m = max(A)
    a = A.index(m)
    A.pop(a)
    b = max(A)

    for i in range(N):
        if i == a:
            print(b)
        else:
            print(m)


if __name__ == '__main__':
    p_c()
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
a=list(range(N,N+L))
print(sum(a)-min(a,key=abs))

Fixed submission:
N,L=map(int,input().split())
a=list(range(L,N+L))
print(sum(a)-min(a,key=abs))
Buggy python submission (verdict: Runtime Error):
def p_c():
    W, H, x, y = map(int, input().split())
    is0 = W / 2 == x ^ H / 2 == y
    print(W * H / 2, 0 if is0 else 1)
    
p_c()

Fixed submission:
def p_c():
    W, H, x, y = map(int, input().split())
    is1 = (W / 2 == x) and (H / 2 == y)
    print(W * H / 2, 1 if is1 else 0)
    
p_c()