Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
numbers = [int(x) for x in input().split()]

if any [x == 0 for x in numbers]:
  print(0)
else:
  t = numbers [0]
  for el in numbers:
  	while total < 10**18:
    	t *= el 
  	if t < 10**18:
    	print(t)
    else:
      print(-1)

Fixed submission:
N = int(input())
liste = input().split()
number = [int(x) for x in liste]
total = 1
i = 0
if 0 in number:
    total = 0
else:
    while i < N:
            total *= number[i]
            i = i + 1
            if total > 10**18:
                total = -1
                break
print(total)

Buggy python submission (verdict: Runtime Error):
i = 0
if 0 in number:
    total = 0
else:
    while i < N:
            total *= number[i]
            i = i + 1
            if total > 10**18:
                total = -1
                break
print(total)

Fixed submission:
N = int(input())
liste = input().split()
number = [int(x) for x in liste]
total = 1
i = 0
if 0 in number:
    total = 0
else:
    while i < N:
            total *= number[i]
            i = i + 1
            if total > 10**18:
                total = -1
                break
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
liste = input().split()
number = [int(x) for x in liste]
# print(N,number)
total = 1
i = 0
while i < N:
    if 0 in number:
        total = 0
        break
    else:
        total *= number[i]
        i = i + 1
        if total > 10**18:
            total = -1
            break
print(total)

Fixed submission:
N = int(input())
liste = input().split()
number = [int(x) for x in liste]
total = 1
i = 0
if 0 in number:
    total = 0
else:
    while i < N:
            total *= number[i]
            i = i + 1
            if total > 10**18:
                total = -1
                break
print(total)
Buggy python submission (verdict: Runtime Error):
chr = input().split(" 0 ")
a = (int(chr[1])-int(chr[0]))*60 - int(chr[-1])
print(a)

Fixed submission:
chr = input().split()
a = (int(chr[2]) - int(chr[0]))*60 + (int(chr[3]) - int(chr[1])) - int(chr[-1])
print(a)

Buggy python submission (verdict: Runtime Error):
chr = input().split(" 0 ")
print(chr)
a = (int(chr[1])-int(chr[0]))*60 - int(chr[-1])
print(a)

Fixed submission:
chr = input().split()
a = (int(chr[2]) - int(chr[0]))*60 + (int(chr[3]) - int(chr[1])) - int(chr[-1])
print(a)

Buggy python submission (verdict: Runtime Error):
chr = input().split(" 0 ")
print(chr)
a = (int(chr[1])-int(chr[0]))*60 - int(chr[-1])
print(a)

Fixed submission:
chr = input().split()
a = (int(chr[2]) - int(chr[0]))*60 + (int(chr[3]) - int(chr[1])) - int(chr[-1])
print(a)
Buggy python submission (verdict: Runtime Error):
import math

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

mod = 998244353

fac = [0] * N
finv = [0] * N
inv = [0] * N

fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2, N):
    fac[i] = fac[i - 1] * i % mod
    inv[i] = mod - inv[mod % i] * (mod // i) % mod
    finv[i] = finv[i - 1] * inv[i] % mod

def com(n, k):
    global fac, finv, mod
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod

ans = pow(M, N, mod)
for L in range(K + 1, N):
    result = (M * pow(M - 1, N - L - 1, mod) * com(N - 1, N - L - 1)) % mod
    ans -= result

print(ans % mod)


Fixed submission:
import math

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

if N == 1:
    print(M)
    exit(0)

mod = 998244353

fac = [0] * N
finv = [0] * N
inv = [0] * N

fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2, N):
    fac[i] = fac[i - 1] * i % mod
    inv[i] = mod - inv[mod % i] * (mod // i) % mod
    finv[i] = finv[i - 1] * inv[i] % mod

def com(n, k):
    global fac, finv, mod
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod

ans = pow(M, N, mod)
for L in range(K + 1, N):
    result = (M * pow(M - 1, N - L - 1, mod) * com(N - 1, N - L - 1)) % mod
    ans -= result

print(ans % mod)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import lru_cache

@lru_cache(maxsize=None)
def gcd(a, b, c):
    return math.gcd(math.gcd(a, b), c)


k = int(input())
answer = 0
for a in range(1, k + 1):
    for b in range(1, k + 1):
        for c in range(1, k + 1):
            ary = [a, b, c]
            ary.sort()
            answer += gcd(ary[0], ary[1], ary[2])

print(answer)


Fixed submission:
import math
from functools import lru_cache

@lru_cache(maxsize=None)
def gcd(x, y):
    return math.gcd(x, y)


k = int(input())
answer = 0
ary = []
for a in range(1, k + 1):
    for b in range(1, k + 1):
        if a >= b:
            ary.append(gcd(b, a))
        else:
            ary.append(gcd(a, b))

h = {}
for a in ary:
    if a not in h:
        h[a] = 0
    h[a] += 1
# print(h)

for x in h.keys():
    for c in range(1, k + 1):
        answer += gcd(x, c) * h[x]
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

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

removes = {}

c = collections.Counter(A)
c2 = {}
for key in c:
    if c[key] > 1:
        c2[key] = c[key]

def comb(n):
    return (n * (n - 1)) // 2

# print(c2)
for k in range(N):
    i = A[k]
    if i not in removes:
        i_sum = 0
        for key in c2:
            if i == key:
                i_sum += comb(c2[key] - 1)
            else:
                i_sum += comb(c2[key])
        removes[i] = i_sum
    print(removes[i])


Fixed submission:
import collections

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

# k番目の数字の総数がkey、そのときの答えがvalue
removes = {}

c = collections.Counter(A)
c2 = {}
for key in c:
    if c[key] > 1:
        c2[key] = c[key]

def comb(n):
    return (n * (n - 1)) // 2

# print(c2)
for k in range(N):
    # k番目の数字
    i = A[k]
    # k番目の数字の総数
    count = c[i]
    if count not in removes:
        answer = 0
        for key in c2:
            if i == key:
                answer += comb(c2[key] - 1)
            else:
                answer += comb(c2[key])
        removes[count] = answer
    print(removes[count])
Buggy python submission (verdict: Time Limit Exceeded):
H, N = map(int, input().split())

ab = []
max_a = 0
min_a = 10001
for i in range(N):
    a, b = map(int, input().split())
    if a > max_a:
        max_a = a
    if a < min_a:
        min_a = a
    ab.append([a, b])

# print(max_a, min_a)
inf = float('inf')
dp = [inf for _ in range(H + max_a)]

for a, b in ab:
    for i in range(1, len(dp)):
        # 魔法aだけで体力iを減らすために魔法を使う回数
        times = i // a + (0 if i % a == 0 else 1)
        # 使う魔力
        power = b * times
        if i - a > 0:
            power = min(power, dp[i - a] + b)
        dp[i] = min(dp[i], power)

print(min(dp[H:]))


Fixed submission:
import numpy as np

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

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

ab = np.array(ab)
a_list = ab[:, 0]
b_list = ab[:, 1]
max_a = ab.max()

inf = float('inf')
dp = np.array([inf for _ in range(H + max_a)])
dp[0] = 0

for i in range(1, len(dp)):
    dp[i] = np.amin(dp[np.maximum(i - a_list, 0)] + b_list)

print(int(min(dp[H:])))

Buggy python submission (verdict: Time Limit Exceeded):
H, N = map(int, input().split())
dp = [0 for i in range(H + 10 ** 4 + 1)]

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

for i in range(1, H + 1):
    values = []
    for a, b in ab:
        values.append(dp[i - a] + b)
    dp[i] = min(values)

print(dp[H])


Fixed submission:
import numpy as np

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

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

ab = np.array(ab)
a_list = ab[:, 0]
b_list = ab[:, 1]
max_a = ab.max()

inf = float('inf')
dp = np.array([inf for _ in range(H + max_a)])
dp[0] = 0

for i in range(1, len(dp)):
    dp[i] = np.amin(dp[np.maximum(i - a_list, 0)] + b_list)

print(int(min(dp[H:])))

Buggy python submission (verdict: Time Limit Exceeded):
H, N = map(int, input().split())
dp = [0 for i in range(H + 10 ** 4 + 1)]

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

for i in range(1, H + 10 ** 4 + 1):
    values = []
    for a, b in ab:
        values.append(dp[i - a] + b)
    dp[i] = min(values)

print(min(dp[H:]))


Fixed submission:
import numpy as np

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

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

ab = np.array(ab)
a_list = ab[:, 0]
b_list = ab[:, 1]
max_a = ab.max()

inf = float('inf')
dp = np.array([inf for _ in range(H + max_a)])
dp[0] = 0

for i in range(1, len(dp)):
    dp[i] = np.amin(dp[np.maximum(i - a_list, 0)] + b_list)

print(int(min(dp[H:])))
Buggy python submission (verdict: Time Limit Exceeded):
import re

n = int(input())
s = input()

numbers = set()

def exists(i, j, k, s):
  pattern = '.*' + str(i) + '.*' + str(j) + '.*' + str(k) + '.*'
  result = re.match(pattern, s)
  return result is not None

for i in range(0, 10):
  for j in range(0, 10):
    for k in range(0, 10):
      if exists(i, j, k, s):
        numbers.add(str(i) + str(j) + str(k))

# print(numbers)
print(len(numbers))


Fixed submission:
n = int(input())
s = list(map(int, list(input())))

ary1 = [0 for i in range(10)]
ary2 = [[0 for i in range(10)] for j in range(10)]
ary3 = [[[0 for i in range(10)] for j in range(10)] for k in range(10)]

for ss in s:
  for i in range(10):
    for j in range(10):
      if ary1[i] == 1 and ary2[i][j] == 1:
        ary3[i][j][ss] = 1
  for i in range(10):
    if ary1[i] == 1:
      ary2[i][ss] = 1
  ary1[ss] = 1

numbers = set()

def exists(i, j, k, s):
  return ary3[i][j][k] == 1

for i in range(0, 10):
  for j in range(0, 10):
    for k in range(0, 10):
      if exists(i, j, k, s):
        numbers.add(str(i) + str(j) + str(k))

# print(numbers)
print(len(numbers))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(int, list(input())))

numbers = set()

def exists(i, j, k, s):
  i_exists = False
  j_exists = False

  for ss in s:
    if i_exists == False and i == ss:
      i_exists = True
    elif j_exists == False and j == ss and i_exists:
      j_exists = True
    elif k == ss and i_exists and j_exists:
      return True
  return False

for i in range(0, 10):
  for j in range(0, 10):
    for k in range(0, 10):
      if exists(i, j, k, s):
        numbers.add(str(i) + str(j) + str(k))

# print(numbers)
print(len(numbers))


Fixed submission:
n = int(input())
s = list(map(int, list(input())))

ary1 = [0 for i in range(10)]
ary2 = [[0 for i in range(10)] for j in range(10)]
ary3 = [[[0 for i in range(10)] for j in range(10)] for k in range(10)]

for ss in s:
  for i in range(10):
    for j in range(10):
      if ary1[i] == 1 and ary2[i][j] == 1:
        ary3[i][j][ss] = 1
  for i in range(10):
    if ary1[i] == 1:
      ary2[i][ss] = 1
  ary1[ss] = 1

numbers = set()

def exists(i, j, k, s):
  return ary3[i][j][k] == 1

for i in range(0, 10):
  for j in range(0, 10):
    for k in range(0, 10):
      if exists(i, j, k, s):
        numbers.add(str(i) + str(j) + str(k))

# print(numbers)
print(len(numbers))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
from functools import reduce
from operator import mul

N = int(input())
# a, b, x = map(lambda i: int(i), input().split(' '))

def main():
    # hen1 = a / 2
    # hen2 = b - (x / (a * a))
    # print(math.degrees(math.atan(hen2 / hen1)))
    primes = prime_factorize(N)
    if len(primes) == 1:
        print(primes[0] - 1)
        return
    elif len(primes) == 2:
        print(primes[0] + primes[1] - 2)
        return

    min = -1
    for i in range(1, len(primes) + 1):
        for v in itertools.combinations(primes, i):
            a = reduce(mul, list(v))
            b = N // a
            if min == -1 or min > (a + b - 2):
                min = a + b - 2
    print(min)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

main()


Fixed submission:
import math

N = int(input())
# a, b, x = map(lambda i: int(i), input().split(' '))

def main():
    root_n = math.sqrt(N)
    answer = -1
    for a in range(1, int(root_n) + 1):
        if N % a == 0:
            b = N // a
            v = a + b - 2
            if answer == -1 or answer > v:
                answer = v
    print(v)

main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

def main():
    n, m = map(int, input().split())
    ans = set([i for i in range(1 , n + 1)])
    for _ in range(m):
        l, r = map(int, input().split())
        card = set([i for i in range(l, r + 1)])
        ans = ans & card
    print(len(ans))

if __name__ == '__main__':
    main()


Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

def solve(l1, r1, l2, r2):
    if r1 < l2 or r2 < l1:
        return None
    elif l1 < l2 and r1 < r2:
        return [l2, r1]
    elif l1 >= l2 and r1 <= r2:
        return [l1, r1]
    elif l1 <= l2 and r2 <= r1:
        return [l2, r2]
    else:
        return [l1, r2]


def main():
    n, m = map(int, input().split())
    ans = [1, n]
    for _ in range(m):
        l, r = map(int, input().split())
        # print(l, r)
        ans = solve(ans[0], ans[1], l, r)
        # print(ans)
        if ans is None:
            print(0)
            exit(0)
    print(ans[1] - ans[0] + 1)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def is_ok(A, index, key):
    return A[index] >= key


def binary_search(A, key):
    ng = -1
    ok = len(A)

    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if is_ok(A, mid, key):
            ok = mid
        else:
            ng = mid

    return ok


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    for m in range(M):
        B, C = map(int, input().split())
        idx = binary_search(A, C)
        A[idx:idx] = [C] * B
        A = A[B:]

    print(sum(A))

main()


Fixed submission:
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    h = {}
    for a in A:
        if a in h:
            h[a] += 1
        else:
            h[a] = 1
    for m in range(M):
        B, C = map(int, input().split())
        if C in h:
            h[C] += B
        else:
            h[C] = B
    nums = list(h.keys())
    nums.sort(reverse=True)
    c = 0
    s = 0
    for i in nums:
        if c + h[i] >= N:
            s += i * (N - c)
            break
        else:
            c += h[i]
            s += i * h[i]
    print(s)

main()
Buggy python submission (verdict: Runtime Error):
x1, y1, x2, y2 = map(int, input().split(" "))
a_2 = (x1 - x2) ** 2 + (y1 - y2) ** 2
x2dash = x2 - x1
y2dash = y2 - y1
x3, y3, x4, y4 = [None, None, None, None]

for x in range(-250, 250):
	for y in range(-250, 250):
		first = (x2dash - x) ** 2 + (y2dash - y) ** 2
		second = x ** 2 + y ** 2
		if first == a_2 and second == 2 * a_2:
			if x2dash >= 0 and y2dash >= 0:
				if x <= x2dash and y >= y2dash:
					x3, y3 = [x, y]
					break
			elif x2dash >= 0 and y2dash <= 0:
				if x >= x2dash and y >= y2dash:
					x3, y3 = [x, y]
					break
			elif x2dash <= 0 and y2dash <= 0:
				if x >= x2dash and y <= y2dash:
					x3, y3 = [x, y]
					break
			else:
				if x <= x2dash and y <= y2dash:
					x3, y3 = [x, y]
					break

for x in range(-250, 250):
	for y in range(-250, 250):
		first = x ** 2 + y ** 2
		second = (x3 - x) ** 2 + (y3 - y) ** 2
		if first == a_2 and second == a_2 and x != x2dash and y != y2dash:
			x4, y4 = [x, y]
			break

print(x3 + x1, y3 + y1, x4 + x1, y4 + y1)


Fixed submission:
x1, y1, x2, y2 = map(int, input().split(" "))
x = x2 - x1
y = y2 - y1
print(x2 - y, y2 + x, x1 - y, y1 + x)
Buggy python submission (verdict: Time Limit Exceeded):
t = int(input())

def sub(a, b, c, d):
	values = [a]
	i = a
	while (True):
		i = i % b if i > b else i - b
		if i < 0:
			return 'No'
		if i <= c:
			i += d
		if i in values:
			return 'Yes'
		values.append(i)
	return 'No'

def main():
	for i in range(0, t):
		a, b, c, d = map(int, input().split(' '))
		print(sub(a, b, c, d))

main()


Fixed submission:
import fractions

T = int(input())

def solve(A, B, C, D):
    left = A
    if A < B:
        print('No')
        return
    if D < B:
        print('No')
        return
    if C >= B:
        print('Yes')
        return
    g = fractions.gcd(B, D)
    max_mod_b = B - g + (A % g)
    if max_mod_b > C:
        print('No')
    else:
        print('Yes')

for _ in range(T):
    A, B, C, D = map(int, input().split())
    solve(A, B, C, D)
Buggy python submission (verdict: Runtime Error):
def main():
  N, K = map(lambda i: int(i), input().split(' '))
  l = list(map(lambda i: int(i), input().split(' '))
  l.sort()
  l.reverse()
  m = 0
  for i in range(K):
    m += l[i]
  print(m)

main()

Fixed submission:
def main():
  N, K = map(lambda i: int(i), input().split(' '))
  l = list(map(lambda i: int(i), input().split(' ')))
  l.sort()
  l.reverse()
  m = 0
  for i in range(K):
    m += l[i]
  print(m)

main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = list(map(int,input().split(" ")))
mul = 1
for i in range(n):
    mul *= a_list[i]
if mul > 10**18:
    print(-1)
else:
    print(mul)

Fixed submission:
n = int(input())
a_list = list(map(int,input().split(" ")))
mul = 1
if 0 in a_list:
    print(0)
else:
    for i in range(n):
        if mul > 10**18:
            break
        else:
            mul *= a_list[i]
    if mul <= 10**18:
        print(mul)
    else:
        print(-1)
Buggy python submission (verdict: Runtime Error):
mport math
a,b,c,d = map(int,input().split(" "))
taka = math.ceil(c/b)
aoki = math.ceil(a/d)

if taka <= aoki:
    print("Yes")
else:
    print("No")

Fixed submission:
import math
a,b,c,d = map(int,input().split(" "))
taka = math.ceil(c/b)
aoki = math.ceil(a/d)

if taka <= aoki:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split(" ")))
 
managelist = [0] *n
 
for i in range(n-1):
   a_count = a.count(i+1)
   managelist[i] = a_count

for i in range(n):
    print(managelist[i])

Fixed submission:
n = int(input())
a = list(map(int,input().split(" ")))
# print(a)

managelist = [0] * n
# print(managelist) 
# manage_d = {}

for i in range(n-1):
    managelist[a[i]-1] += 1
    # print(managelist)

for i in range(n):
    print(managelist[i])
Buggy python submission (verdict: Runtime Error):
x = list(map(int,input().split(" ")))
h = x[0]
w = x[1]

ans = 0
if h % 2 == 0:
    for i in range(w):
        ans += h/2
    print(int(ans))
elif w % 2 == 0:
    for i in range(w/2):
        ans += h
    print(int(ans))
else:
    for i in range(w//2):
        ans += h
    ans += h // 2 +1
    print(int(ans))


Fixed submission:
x = list(map(int,input().split(" ")))
h = x[0]
w = x[1]

ans = 0
if h == 1:
    print(1)
elif w == 1:
    print(1)
elif h % 2 == 0:
    ans = int(h/2 * w)
    print(ans)
elif (h % 2 != 0) and (w % 2 == 0):
    ans = int(h * w/2)
    print(ans)
elif (h % 2 != 0) and (w % 2 != 0):
    ans = int((h//2 +1) * (w//2 +1)) + (h//2 * (w - 1 - w//2))
    print(int(ans))

Buggy python submission (verdict: Runtime Error):
ans = 0
if h % 2 == 0:
    for i in range(w):
        ans += h/2
    print(int(ans))
elif w % 2 == 0:
    for i in range(w/2):
        ans += h
    print(int(ans))
else:
    for i in range(w//2):
        ans += h
    ans += h // 2 +1
    print(int(ans))


Fixed submission:
x = list(map(int,input().split(" ")))
h = x[0]
w = x[1]

ans = 0
if h == 1:
    print(1)
elif w == 1:
    print(1)
elif h % 2 == 0:
    ans = int(h/2 * w)
    print(ans)
elif (h % 2 != 0) and (w % 2 == 0):
    ans = int(h * w/2)
    print(ans)
elif (h % 2 != 0) and (w % 2 != 0):
    ans = int((h//2 +1) * (w//2 +1)) + (h//2 * (w - 1 - w//2))
    print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s_list = []

for i in range(n):
    s_list.append(input())
    
import collections
s_dict = collections.Counter(s_list)
max_s_dict = [k for k, v in s_dict.items() if v == max(s_dict.values())]
max_s_dict.sort()
for i in range (len(max_s_dict)):
    print(max_s_dict[i])


Fixed submission:
n = int(input())
s_list = []
import collections

for i in range(n):
    s_list.append(input())

s_dict = collections.Counter(s_list)
maxv = max(s_dict.values())

keys = [k for k,v in s_dict.items() if v == maxv]
keys.sort()
for i in range (len(keys)):
    print(keys[i])
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

count = 0

for i in range(n):
    if s[i] == "A":
        if s[i+1] == "B":
            if s[i+2] == "C":
                count += 1

print(count)

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

count = 0

for i in range(n-2):
    if s[i] == "A":
        if s[i+1] == "B":
            if s[i+2] == "C":
                count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

count = 0

for i in range(n):
    if s[i] == "A":
        if s[i+1] == "B":
            if s[i+2] == "C":
                count += 1
            else:
                continue
        else:
            continue
    else:
        continue

print(count)

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

count = 0

for i in range(n-2):
    if s[i] == "A":
        if s[i+1] == "B":
            if s[i+2] == "C":
                count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
n_list = n.split(" ")
a = int(n_list[0])
b = int(n_list[1])
k = int(n_list[2])

if k < a:
    a = a-k
elif k >= a and k-a < b:
    a = 0
    b = b - (k-a)
elif k-a >= b:
    a = 0
    b = 0

print(str(a) + " " + str(b))

Fixed submission:
n = input()
n_list = n.split(" ")
a = int(n_list[0])
b = int(n_list[1])
k = int(n_list[2])

if k < a:
    a = a-k
    b = b
    print(str(a) + " " + str(b))
elif k >= a and k-a < b:
    b = b - (k-a)
    print(str(0) + " " + str(b))
elif k >= a and k-a >= b:
    a = 0
    b = 0
    print(str(0) + " " + str(0))
Buggy python submission (verdict: Runtime Error):


import math
x_sq = math.sqrt(x)
x_sq_it = int(x_sq)

pnlist = [2]

countn = 0
for i in range(3,x_sq_it+1):
    for j in range(len(pnlist)):
        if i % pnlist[j] == 0:
            break
        else:
            countn += 1
    if countn == len(pnlist):
        pnlist.append(i)
        countn = 0
# print(pnlist)

countn = 0
for i in range(x,10**5):
    for j in range(len(pnlist)):
        if i % pnlist[j] == 0:
            break
        else:
            countn += 1
    if countn == len(pnlist):
        print(i)
        exit()
    else:
        countn = 0

Fixed submission:
x = int(input())
while any(x % i == 0 for i in range(2,x)):
    x += 1
print(x)
Buggy python submission (verdict: Runtime Error):
s = input()
nl = len(s)

alp =["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
s_new = []

for i in range(nl):
    newnumber = alp.index(s[i])+n
    if newnumber > 25:
        newnumber = newnumber - 26
    newi = alp[newnumber]
    s_new.append(newi)

s_ans = ""
for i in range(nl):
    s_ans += s_new[i]
print(s_ans)

Fixed submission:
n = int(input())
s = input()
nl = len(s)

alp =["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
s_ans = ""

for i in range(nl):
    newnumber = alp.index(s[i])+n
    if newnumber > 25:
        newnumber = newnumber - 26
    newi = alp[newnumber]
    s_ans += newi

print(s_ans)