Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from sys import exit

N, M = map(int, input().split())

ans = []

for i in range(M):
    L, R = map(int, input().split())

    if i == 0:
        for card in range(L, R + 1):
            ans.append(card)
        continue

    if ans[0] < L:
        for card in range(ans[0], L):
            ans.remove(card)

    if R < ans[-1]:
        for card in range(R + 1, ans[-1] + 1):
            ans.remove(card)

    if not ans:
        print(0)
        exit()

print(len(ans))


Fixed submission:
from sys import exit

N, M = map(int, input().split())

L = []
R = []

for i in range(M):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)

l_max = max(L)
r_min = min(R)

if (r_min - l_max) < 0:
    print(0)
else:
    print(r_min - l_max + 1)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import exit

R, G, B, N = map(int, input().split())

count = 0

for r in range(N // R + 1):
	for g in range((N - r * R) // G + 1):
		if N - r * R - g * G < 0:
			break
		if (N - r * R - g * G) % B == 0:
			count += 1

print(count)


Fixed submission:
from sys import exit

R, G, B, N = map(int, input().split())

count = 0

for r in range(N // R + 1):
	for g in range((N - r * R) // G + 1):
		if (N - r * R - g * G) % B == 0:
			count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import exit

R, G, B, N = map(int, input().split())

count = 0

for r in range(N // R + 1):
	for g in range(N // G + 1):
		if N - r * R - g * G < 0:
			break
		if (N - r * R - g * G) % B == 0:
			count += 1

print(count)


Fixed submission:
from sys import exit

R, G, B, N = map(int, input().split())

count = 0

for r in range(N // R + 1):
	for g in range((N - r * R) // G + 1):
		if (N - r * R - g * G) % B == 0:
			count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import exit

R, G, B, N = map(int, input().split())

count = 0

for r in range(N // R + 1):
	for g in range(N // G + 1):
		if (N - r * R - g * G) % B == 0 and N - r * R - g * G >= 0:
			count += 1

print(count)


Fixed submission:
from sys import exit

R, G, B, N = map(int, input().split())

count = 0

for r in range(N // R + 1):
	for g in range((N - r * R) // G + 1):
		if (N - r * R - g * G) % B == 0:
			count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
from sys import exit

R, G, B, N = map(int, input().split())

count = 0

for r in range(N // R + 1):
	for g in range(N // G + 1):
		for b in range(N // B + 1)
			if r + g + b == N:
				count += 1

print(count)


Fixed submission:
from sys import exit

R, G, B, N = map(int, input().split())

count = 0

for r in range(N // R + 1):
	for g in range((N - r * R) // G + 1):
		if (N - r * R - g * G) % B == 0:
			count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
from sys import exit

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


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

    if b == 0:
        return a

    temp = a % b
    while temp != 0:
        a = b
        b = temp
        temp = a % b

    return b


# 0 ~ i
def left(i):
    if i == 0:
        return 0

    if left(i - 1) > A[i - 1]:
        return gcd(left(i - 1), A[i - 1])
    else:
        return gcd(A[i - 1], left(i - 1))


# i ~ N-1
def right(i):
    if i == N - 1:
        return 0

    if right(i + 1) > A[i + 1]:
        return gcd(right(i + 1), A[i + 1])
    else:
        return gcd(A[i + 1], right(i + 1))


ans = []

for i in range(N):
    ans.append(gcd(left(i), right(i)))

print(max(ans))


Fixed submission:
from sys import exit

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


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

    if b == 0:
        return a

    temp = a % b
    while temp != 0:
        a = b
        b = temp
        temp = a % b

    return b


left = [0 for i in range(N)]
right = left[:]

for i in range(1, N):
    left[i] = gcd(A[i - 1], left[i - 1])
    right[-i - 1] = gcd(A[-i], right[-i])

ans = [gcd(left[i], right[i]) for i in range(N)]

print(max(ans))

Buggy python submission (verdict: Runtime Error):
from sys import exit

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


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

    if b == 0:
        return a

    temp = a % b
    while temp != 0:
        a = b
        b = temp
        temp = a % b

    return b


# 0 ~ i
def left(i):
    if i == 0:
        return 0

    return gcd(left(i - 1), A[i - 1])


# i ~ N-1
def right(i):
    if i == N - 1:
        return 0

    return gcd(right(i + 1), A[i + 1])


ans = []

for i in range(N):
    ans.append(gcd(left(i), right(i)))

print(max(ans))


Fixed submission:
from sys import exit

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


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

    if b == 0:
        return a

    temp = a % b
    while temp != 0:
        a = b
        b = temp
        temp = a % b

    return b


left = [0 for i in range(N)]
right = left[:]

for i in range(1, N):
    left[i] = gcd(A[i - 1], left[i - 1])
    right[-i - 1] = gcd(A[-i], right[-i])

ans = [gcd(left[i], right[i]) for i in range(N)]

print(max(ans))
Buggy python submission (verdict: Runtime Error):
from sys import exit

time = [int(input()), int(input()), int(input()), int(input()), int(input())]

total = 0
loss = []

for t in time:
    total += t
    if t % 10 != 0:
        loss.append(10 - t % 10)

total += sum(loss) - max(loss)

print(total)


Fixed submission:
from sys import exit

time = [int(input()), int(input()), int(input()), int(input()), int(input())]

total = 0
loss = []

for t in time:
    total += t
    if t % 10 != 0:
        loss.append(10 - t % 10)

if loss:
    total += sum(loss) - max(loss)

print(total)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import exit

X, Y, Z, K = map(int, input().split())

A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

score = []

for i in range(X):
    for j in range(Y):
        score.append(A[i] + B[j])

score.sort(reverse=True)

ans = []

for i in range(min(K, len(score))):
    for j in range(Z):
        ans.append(score[i] + C[j])

ans.sort(reverse=True)

for i in range(K):
    print(ans[i])


Fixed submission:
from sys import exit

X, Y, Z, K = map(int, input().split())

A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

ABC = []

for a in range(X):
    for b in range(Y):
        if (a + 1) * (b + 1) > K:
            break
        for c in range(Z):
            if (a + 1) * (b + 1) * (c + 1) > K:
                break
            ABC.append(A[a] + B[b] + C[c])

ABC.sort(reverse=True)

for i in range(K):
    print(ABC[i])
Buggy python submission (verdict: Time Limit Exceeded):
from sys import exit

N = int(input())
S = input()


def get_count():
    count = 1

    considered = []

    for s in S:
        if s not in considered:
            count *= S.count(s) + 1
        considered.append(s)

    count -= 1

    return count


ans = get_count() % (10 ** 9 + 7)

print(ans)


Fixed submission:
from sys import exit

N = int(input())
S = input()


def get_count():
    count = 1

    m = {}

    for s in S:
        if s in m.keys():
            m[s] += 1
        else:
            m[s] = 1

    for k in m:
        count *= m[k] + 1

    count -= 1

    return count


ans = get_count() % (10 ** 9 + 7)

print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import exit

N, M = map(int, input().split())

shops = {}

for _ in range(N):
    A, B = map(int, input().split())
    if shops[A]:
        shops[A] += B
    else:
        shops[A] = B

shops = sorted(shops.items())
ans = 0

for k in shops:
    if M - k[1] <= 0:
        ans += k[0] * M
        break
    else:
        ans += k[0] * k[1]
        M -= k[1]

print(ans)


Fixed submission:
from sys import exit

N, M = map(int, input().split())

shops = {}

for _ in range(N):
    A, B = map(int, input().split())
    if A in shops.keys():
        shops[A] += B
    else:
        shops[A] = B

shops = sorted(shops.items())
ans = 0

for k in shops:
    if M - k[1] <= 0:
        ans += k[0] * M
        break
    else:
        ans += k[0] * k[1]
        M -= k[1]

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import exit

A, B = map(int, input().split())

ans = 0

for i in range(A, B + 1):
    ans = ans ^ i

print(ans)


Fixed submission:
from sys import exit

A, B = map(int, input().split())


def get_xor(x):
    if x % 4 == 0:
        return x
    elif x % 4 == 1:
        return 1
    elif x % 4 == 2:
        return 1 + x
    elif x % 4 == 3:
        return 0


ans = get_xor(A - 1) ^ get_xor(B)

print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    N, M = map(int, input().split())
    X = list(map(int, input().split()))
    X_sort = sorted(X)
    diff = []
    for i in range(M - 1):
        diff.append(X_sort[i + 1] - X_sort[i])
    diff_sort = sorted(diff)
    if M == 1:
        print("0")
        return
    for _ in range(N - 1):
        diff_sort.pop()
    ans = 0
    for d in diff_sort:
        ans += d
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N, M = map(int, input().split())
    X = list(map(int, input().split()))
    if N >= M:
        print('0')
        return 
    X_sort = sorted(X)
    diff = []
    for i in range(M - 1):
        diff.append(X_sort[i + 1] - X_sort[i])
    diff_sort = sorted(diff)
    if N != 1:
        for _ in range(N - 1):
            diff_sort.pop()
    ans = 0
    for d in diff_sort:
        ans += d
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    A = []
    B = []
    C = []
    for _ in range(n):
        a, b = map(int, input().split())
        A.append(a)
        B.append(b)
        C.append(a + b)
    ans = 0
    isA = True
    while C:
        index = C.index(max(C))
        C.pop(index)
        if isA:
            ans += A[index]
        else:
            ans -= B[index]
        isA = not isA
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    n = int(input())
    A = []
    B = []
    C = {}
    for i in range(n):
        a, b = map(int, input().split())
        A.append(a)
        B.append(b)
        C[str(i)] = a + b
    ans = 0
    isA = True
    for k, v in sorted(C.items(), key=lambda x: -x[1]):
        if isA:
            ans += A[int(k)]
        else:
            ans -= B[int(k)]
        isA = not isA
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    N, K = map(int, input().split())
    td = []
    for _ in range(N):
        ti, di = map(int, input().split())
        td.append([ti, di])
    td.sort(key=lambda x: -x[1])
    num = 0
    kind = set()
    changable = []
    for i in range(K):
        num += td[i][1]
        if td[i][0] in kind:
            changable.append(td[i][0])
        else:
            kind.add(td[i][0])
    num += len(kind) ** 2
    ans = num

    for i in range(K, N):
        if not changable:
            break
        if td[i][0] not in kind:
            num += td[i][1] + 2 * len(kind) + 1 - changable.pop()
            kind.add(td[i][0])
            ans = max(ans, num)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    AB, BC, CA = map(int, input().split())
    print(int(AB * BC / 2))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, M = map(int, input().split())
    P = []
    Y = []
    for _ in range(M):
        pi, yi = [int(i) for i in input().split()]
        P.append(pi)
        Y.append(yi)
    temp_dict = {}
    for i in range(N):
        temp_list = [Y[k] for k, x in enumerate(P) if x == i+1]
        temp_list.sort()
        for i in range(len(temp_list)):
            temp_dict[str(temp_list[i])] = i+1

    for i in range(M):
        print(str(P[i]).zfill(6) + str(temp_dict[str(Y[i])]).zfill(6))


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N, M = map(int, input().split())
    Lw = []
    T = []
    for _ in range(M):
        pi, yi = [int(i) for i in input().split()]
        T.append(pi)
        T.append(yi)
        Lw.append(T)
        T = []
    temp_dict = {}
    answer_dict = {}
    L = Lw.copy()
    L.sort(key=lambda x: x[1])
    for i in range(N):
        temp_dict[str(i+1)] = 1
    for l in L:
        answer_dict[str(l[1])] = temp_dict[str(l[0])]
        temp_dict[str(l[0])] += 1

    for lw in Lw:
        print(str(lw[0]).zfill(6) + str(answer_dict[str(lw[1])]).zfill(6))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, M = map(int, input().split())
    P = []
    Y = []
    for _ in range(M):
        pi, yi = [int(i) for i in input().split()]
        P.append(pi)
        Y.append(yi)
    temp_list = []
    temp_dict = {}
    for i in range(N):
        for j in range(M):
            if P[j] == i+1:
                temp_list.append(Y[j])
        temp_list.sort()
        for i in range(len(temp_list)):
            temp_dict[str(temp_list[i])] = i+1
        temp_list = []

    for i in range(M):
        print(str(P[i]).zfill(6) + str(temp_dict[str(Y[i])]).zfill(6))


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N, M = map(int, input().split())
    Lw = []
    T = []
    for _ in range(M):
        pi, yi = [int(i) for i in input().split()]
        T.append(pi)
        T.append(yi)
        Lw.append(T)
        T = []
    temp_dict = {}
    answer_dict = {}
    L = Lw.copy()
    L.sort(key=lambda x: x[1])
    for i in range(N):
        temp_dict[str(i+1)] = 1
    for l in L:
        answer_dict[str(l[1])] = temp_dict[str(l[0])]
        temp_dict[str(l[0])] += 1

    for lw in Lw:
        print(str(lw[0]).zfill(6) + str(answer_dict[str(lw[1])]).zfill(6))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
l = []
for _ in range(N):
    an, bn = map(int, input().split())
    for _ in range(bn):
        l.append(an)
l.sort()
print(l[K-1])

Fixed submission:
import numpy as np

N, K = map(int, input().split())
a_list = []
b_list = []
for i in range(N):
    a, b = map(int, input().split())
    a_list.append(a)
    b_list.append(b)

a_order = np.argsort(a_list)
kc = 0
for i in range(N):
    kc += b_list[a_order[i]]
    if kc >= K:
        print(a_list[a_order[i]])
        break
Buggy python submission (verdict: Runtime Error):
import math
from Decimal import *

def main():
    N = int(input())
    T = []
    A = []
    for _ in range(N):
        t, a = map(int, input().split())
        T.append(t)
        A.append(a)

    for i in range(N - 1):
        if T[i] / T[i + 1] > 1 or A[i] / A[i + 1] > 1:
            mul = Decimal(max(math.ceil(T[i] / T[i + 1]), math.ceil(A[i] / A[i + 1])))
            A[i + 1] *= mul
            T[i + 1] *= mul
    print(T[N - 1] + A[N - 1])


if __name__ == "__main__":
    main()

Fixed submission:
import math
from decimal import *

def main():
    N = int(input())
    T = []
    A = []
    for _ in range(N):
        t, a = map(int, input().split())
        T.append(t)
        A.append(a)

    for i in range(N - 1):
        if T[i] / T[i + 1] > 1 or A[i] / A[i + 1] > 1:
            mul = Decimal(max(math.ceil(T[i] / T[i + 1]), math.ceil(A[i] / A[i + 1])))
            A[i + 1] *= mul
            T[i + 1] *= mul
    print(T[N - 1] + A[N - 1])


if __name__ == "__main__":
    main()

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


def main():
    N = int(input())
    T = []
    A = []
    for i in range(N):
        t, a = map(int, input().split())
        T.append(t)
        A.append(a)

    for i in range(N):
        if math.gcd(A[i], T[i]) != 1:
            A[i] = A[i] // math.gcd(A[i], T[i])
            T[i] = T[i] // math.gcd(A[i], T[i])

    for i in range(N - 1):

        if T[i] / T[i + 1] > 1 or A[i] / A[i + 1] > 1:
            if T[i] / T[i + 1] >= A[i] / A[i + 1]:
                A[i + 1] = math.ceil(T[i] / T[i + 1]) * A[i + 1]
                T[i + 1] = math.ceil(T[i] / T[i + 1]) * T[i + 1]
            else:
                T[i + 1] = math.ceil(A[i] / A[i + 1]) * T[i + 1]
                A[i + 1] = math.ceil(A[i] / A[i + 1]) * A[i + 1]
    print(T[N - 1] + A[N - 1])


if __name__ == "__main__":
    main()

Fixed submission:
import math
from decimal import *

def main():
    N = int(input())
    T = []
    A = []
    for _ in range(N):
        t, a = map(int, input().split())
        T.append(t)
        A.append(a)

    for i in range(N - 1):
        if T[i] / T[i + 1] > 1 or A[i] / A[i + 1] > 1:
            mul = Decimal(max(math.ceil(T[i] / T[i + 1]), math.ceil(A[i] / A[i + 1])))
            A[i + 1] *= mul
            T[i + 1] *= mul
    print(T[N - 1] + A[N - 1])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import itertools

n, m = input().split()
N = int(n)
M = int(m)

K = []
for i in range(M):
    K.append(list(map(int, input().strip().split(' '))))

P = list(map(int, input().strip().split(' ')))

SW = {0, 1}
SWlist = list(itertools.product(SW, repeat=N))

result = 0
fflag = False

for i in range(len(SWlist)):
    for j in range(len(K)):
        count = 0
        for k in range(K[j][0]):
            if SWlist[i][k] == 1:
                count += 1
        if count % 2 != P[j]:
            fflag = True
            break
    if not fflag:
        result += 1
    else:
        fflag = False
print(result)


Fixed submission:
n, m = input().split()
A = int(n)
P = int(m)

N = A * 3 + P
result = N // 2
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = input().split()
N = int(n)
M = int(m)


s = set([])
card = N
for i in range(M):
    l, r = input().split()
    L = int(l)
    R = int(r)

    for j in range(N):
        if L <= j+1 and j+1 <= R:
            pass
        else:
            s.add(j+1)

print(N - len(list(s)))


Fixed submission:
n, m = input().split()
N = int(n)
M = int(m)

listL = []
listR = []
card = N
for i in range(M):
    l, r = input().split()
    L = int(l)
    R = int(r)

    listL.append(L)
    listR.append(R)

maxL = max(listL)
minR = min(listR)

if minR < maxL:
    result = 0
else:
    result = minR - maxL + 1
print(result)
Buggy python submission (verdict: Runtime Error):
n, m = input().split()
N = int(n)
K = int(m)

S = input()

string = list(S)

string[K+1] = string[K+1].lower()

print(''.join(string))


Fixed submission:
n, m = input().split()
N = int(n)
K = int(m)

S = input()

string = list(S)

string[K-1] = string[K-1].lower()

print(''.join(string))
Buggy python submission (verdict: Runtime Error):
n, q = input().split()
Q = int(q)
s = input()
S = list(s)

array = []
count = 0
ff = False
for i in range(len(S)):
    if len(S) < i+1:
        break
    if S[i] == 'A':
        flag = True
    elif flag == True and S[i] == 'C':
        count += 1
        array.append(-1)
        array.append(count)
        ff = True
    elif flag == True:
        array.append(0)
        array.append(0)
        flag = False
    else:
        array.append(0)

array_q = []
for q in range(Q):
    l, r = input().split()
    array_q.append([int(l), int(r)])

for arr in array_q:
    try:
        if ff != True:
            print(0)
            continue

        if len(array[arr[0]-1:arr[1]-1]) < 2:
            print(0)
            continue

        for a in array[arr[0]-1:]:
            if a == -1:
                flag = True
            elif flag == True:
                minv = a
                break

        for b in reversed(array[:arr[1]]):
            if b != 0 and b != -1:
                maxv = b
                break

        if minv == maxv and maxv != 0:
            print(1)
            
        elif maxv == 0:
            print(0)

        else:
            print(maxv - minv + 1)
            maxv = 0
            minv = 0
    except:
        print(0)

Fixed submission:
h = input()

if h == 'A':
    print("T")
elif h == 'T':
    print("A")
elif h == 'C':
    print("G")
elif h == 'G':
    print("C")
Buggy python submission (verdict: Runtime Error):
n, q = input().split()
Q = int(q)
s = input()
S = list(s)

array = []
count = 0
ff = False
for i in range(len(S)):
    if len(S) < i+1:
        break
    if S[i] == 'A':
        flag = True
        array.append(0)
    elif flag == True and S[i] == 'C':
        count += 1
        array.pop(-1)
        array.append(-1)
        array.append(count)
        ff = True
    elif flag == True:
        array.append(0)
        flag = False
    else:
        array.append(0)

array_q = []
for q in range(Q):
    l, r = input().split()
    array_q.append([int(l), int(r)])

for arr in array_q:
    if ff != True:
        print(0)
    if len(array[arr[0]-1:arr[1]-1]) < 2:
        print(0)
        continue
    for a in array[arr[0]-1:]:
        if a == -1:
            flag = True
        elif flag == True:
            minv = a
            break
    for b in reversed(array[:arr[1]]):
        if b != 0 and b != -1:
            maxv = b
            break
    if minv == maxv:
        print(1)
    else:
        print(maxv - minv + 1)


Fixed submission:
h = input()
S = list(h)

atc = ['A', 'T', 'C', 'G']

flag = False
count = 0
maxt = 0
for i in range(len(S)):
    for s in range(len(S)):
        s = s + i
        if len(S) <= s:
            if maxt <= count:
                maxt = count
            break
        if flag == False and (S[s] in atc):
            flag = True
            count += 1
        elif flag == True and (S[s] in atc):
            count += 1
        elif flag == True:
            break
        if maxt < count:
            maxt = count
    count = 0
    flag = False
print(maxt)
Buggy python submission (verdict: Time Limit Exceeded):
st = input()
list_s = []
for s in st:
    list_s.append(s)

delcount = 0
while True:
    if len(list_s) < 2:
        break
    pre = list_s[0]
    count = 0
    for s in list_s:        
        if (pre == '0' and s == '1') or (pre == '1' and s == '0'):
            del list_s[count]
            del list_s[count-1]
            delcount += 1
            break
        count += 1
    if list_s.count('0') == 0 or list_s.count('1') == 0:
        break
print(delcount * 2)


Fixed submission:
st = input()
list_s = list(st)

delcount = 0
count_0 = list_s.count('0')
count_1 = list_s.count('1')
if count_0 < count_1:
    print(count_0 * 2)
else:
    print(count_1 * 2)
Buggy python submission (verdict: Runtime Error):
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
while d <= x or i >= n:
   d+=l[i]
   i+=1

print(i) 

Fixed submission:
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
while d <= x:
    try:
        d+=l[i]
    except:
        i+=1
        break
    i+=1

print(i)

Buggy python submission (verdict: Runtime Error):
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
while d <= x:
   d+=l[i]
   i+=1 

print(i) 

Fixed submission:
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
while d <= x:
    try:
        d+=l[i]
    except:
        i+=1
        break
    i+=1

print(i)

Buggy python submission (verdict: Runtime Error):
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
type(l)
while d <= x:
   d+=l[i]
   i+=1 

print(i) 

Fixed submission:
n,x = (int(i) for i in input().split())  
l = [int(i) for i in input().split()] 
d = 0
i=0
while d <= x:
    try:
        d+=l[i]
    except:
        i+=1
        break
    i+=1

print(i)
Buggy python submission (verdict: Runtime Error):
a,p = map(int,input().split())
print((a*3+p)//2)

Fixed submission:
n = int(input())
print(180*(n-2))