Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
*H, = map(int, input().split())
H.sort(reverse=True)
if len(H) - K <= 0:
    print(0)
else:
    print(sum(H[K:]))

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]
B = sorted(A)
for x in A:
    if x == B[-1]:
        print(B[-2])
    else:
        print(B[-1])

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
import sys
input = sys.stdin.readline
N = int(input())
A = deque([int(input()) for _ in range(N)])

for i in range(N):
    tmp = A.popleft()
    print(max(A))
    A.append(tmp)

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]
B = sorted(A)
for x in A:
    if x == B[-1]:
        print(B[-2])
    else:
        print(B[-1])

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
N = int(input())
A = deque([int(input()) for _ in range(N)])

for i in range(N):
    tmp = A.popleft()
    print(max(A))
    A.append(tmp)

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]
B = sorted(A)
for x in A:
    if x == B[-1]:
        print(B[-2])
    else:
        print(B[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
*A, = [int(input()) for _ in range(N)]
for i in range(N):
    tmp = A[i]
    A[i] = 0
    print(max(A))
    A[i] = tmp

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]
B = sorted(A)
for x in A:
    if x == B[-1]:
        print(B[-2])
    else:
        print(B[-1])
Buggy python submission (verdict: Time Limit Exceeded):
H, W = map(int, input().split())
cnt = [[0] * W for _ in range(H)]
S = [list(input()) for _ in range(H)]

for i in range(H):
    done = [0] * W
    for j in range(W):
        if S[i][j] == '#':
            continue
        if done[j]:
            continue
        l = 0
        while j + l < W:
            if S[i][j+l] == '#':
                break
            l += 1
        for k in range(l):
            cnt[i][j+k] += l
            done[j+k] = 1

for j in range(W):
    done = [0] * H
    for i in range(H):
        if S[i][j] == '#':
            continue
        if done[i]:
            continue
        l = 0
        while i + l < H:
            if S[i+l][j] == '#':
                break
            l += 1
        for k in range(l):
            cnt[i+k][j] += l
            done[i+k] = 1
ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, cnt[i][j]-1)
print(ans)

Fixed submission:
H, W = map(int, input().split())
cnt = [[0] * W for _ in range(H)]
S = [list(input()) for _ in range(H)]

for i in range(H):
    done = [0] * W
    for j in range(W):
        if S[i][j] == '#':
            continue
        if done[j]:
            continue
        l = 0
        while j + l < W:
            if S[i][j+l] == '#':
                break
            l += 1
        for k in range(l):
            cnt[i][j+k] += l
            done[j+k] = 1

for j in range(W):
    done = [0] * H
    for i in range(H):
        if S[i][j] == '#':
            continue
        if done[i]:
            continue
        l = 0
        while i + l < H:
            if S[i+l][j] == '#':
                break
            l += 1
        for k in range(l):
            cnt[i+k][j] += l
            done[i+k] = 1
ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, cnt[i][j]-1)
print(ans)
Buggy python submission (verdict: Runtime Error):
A, P = map(int, input())
print((A*3+P)//2)

Fixed submission:
A, P = map(int, input().split())
print((A*3+P)//2)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
def input():
    return sys.stdin.readline()
def main():
    N, M = map(int, input().split())
    dict = {}
    for _ in range(M):
        L, R = map(int, input().split())
        for x in range(L, R+1):
            if x in dict:
                dict[x] += 1
            else:
                dict[x] = 1
    print(sum([1 for k, v in dict.items() if v == M]))
main()

Fixed submission:
n, m = map(int, input().split())
L, R = 1, n
for i in range(m):
    l, r = map(int, input().split())
    L = max(L, l)
    R = min(R, r)
print(max(R-L+1, 0))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
dict = {}
for _ in range(M):
    L, R = map(int, input().split())
    for x in range(L, R+1):
        if x in dict:
            dict[x] += 1
        else:
            dict[x] = 1
print(sum([1 for k, v in dict.items() if v == M]))

Fixed submission:
n, m = map(int, input().split())
L, R = 1, n
for i in range(m):
    l, r = map(int, input().split())
    L = max(L, l)
    R = min(R, r)
print(max(R-L+1, 0))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
dict = {}
for _ in range(M):
    L, R = map(int, input().split())
    for x in range(L, R+1):
        if x in dict:
            dict[x] += 1
        else:
            dict[x] = 1
print(sum([1 for k, v in dict.items() if v == M]))

Fixed submission:
n, m = map(int, input().split())
L, R = 1, n
for i in range(m):
    l, r = map(int, input().split())
    L = max(L, l)
    R = min(R, r)
print(max(R-L+1, 0))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = sys.stdin.readline
N, M = map(int, input().split())
*A, = map(int, input().split())
lis = []
for _ in range(M):
    B, C = map(int, input().split())
    for _ in range(B):
        lis.append(C)
A.sort()
d = deque(A)
lis.sort(reverse=True)
l = len(lis)
for i in range(l):
    if d[0] < lis[i]:
        d.popleft()
        d.append(lis[i])
print(sum(d))


Fixed submission:
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
*A, = map(int, input().split())
dic = {}
for a in A:
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1
for _ in range(M):
    B, C = map(int, input().split())
    if C in dic:
        dic[C] += B
    else:
        dic[C] = B
dic = list(map(lambda x: list(x), sorted(dic.items(), reverse=True)))
i = 0
ans = 0
for _ in range(N):
    ans += dic[i][0]
    dic[i][1] -= 1
    if dic[i][1] == 0:
        i += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = sys.stdin.readline
N, M = map(int, input().split())
*A, = map(int, input().split())
lis = []
for _ in range(M):
    B, C = map(int, input().split())
    for _ in range(B):
        lis.append(C)
A.sort()
d = deque(A)
lis.sort(reverse=True)
l = len(lis)
for i in range(l):
    if d[0] < lis[i]:
        d.popleft()
        d.append(lis[i])
print(sum(d))


Fixed submission:
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
*A, = map(int, input().split())
dic = {}
for a in A:
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1
for _ in range(M):
    B, C = map(int, input().split())
    if C in dic:
        dic[C] += B
    else:
        dic[C] = B
dic = list(map(lambda x: list(x), sorted(dic.items(), reverse=True)))
i = 0
ans = 0
for _ in range(N):
    ans += dic[i][0]
    dic[i][1] -= 1
    if dic[i][1] == 0:
        i += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = list(input())
S[K] = S[K].lower()
print(''.join(S))

Fixed submission:
N, K = map(int, input().split())
S = list(input())
S[K-1] = S[K-1].lower()
print(''.join(S))
Buggy python submission (verdict: Runtime Error):
S = input()
Fa = int(S[:2])
Se = int(S[2:])
if 1 <= Fa,Se <= 12:
	print("AMBIGIOUS")
elif 1 <= Fa <= 12:
	print("MMYY")
elif 1 <= Se <= 12:
	print("YYMM")
else:
	print("NA")

Fixed submission:
S = input()
Fa = int(S[:2])
Se = int(S[2:])
if 1 <= Fa <= 12 and 1 <= Se <= 12:
	print("AMBIGUOUS")
elif 1 <= Fa <= 12:
	print("MMYY")
elif 1 <= Se <= 12:
	print("YYMM")
else:
	print("NA")

Buggy python submission (verdict: Runtime Error):
S = input()
if 0 <= S[:2] <= 99 and 1 <= S[2:] <= 12:
    print("YYMM")
elif 1 <= S[:2] <= 12 and 0 <= S[2:] <= 99:
    print("MMYY")
elif (0 <= S[:2] <= 99 and 1 <= S[2:] <= 12) and (1 <= S[:2] <= 12 and 0 <= S[2:] <= 99):
    print("AMBIGUOUS")
else:
    print("NA")

Fixed submission:
S = input()
Fa = int(S[:2])
Se = int(S[2:])
if 1 <= Fa <= 12 and 1 <= Se <= 12:
	print("AMBIGUOUS")
elif 1 <= Fa <= 12:
	print("MMYY")
elif 1 <= Se <= 12:
	print("YYMM")
else:
	print("NA")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
def input():
    return sys.stdin.readline().rstrip()
N, Q = map(int, input().split())
S = input()
for q in range(Q):
    l, r = map(int, input().split())
    print(S[l-1:r].count("AC"))

Fixed submission:
import sys
def input():
    return sys.stdin.readline().rstrip()

N, Q = map(int, input().split())
S = input()
li = [0]*(N+1)

for i in range(N):
    if S[i:i+2] == 'AC':
        li[i+1] = li[i] + 1
    else:
        li[i+1] = li[i]

for i in range(Q):
    l, r = map(int, input().split())
    print(li[r-1] - li[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
for q in range(Q):
    l, r = map(int, input().split())
    print(S[l-1:r].count("AC"))

Fixed submission:
import sys
def input():
    return sys.stdin.readline().rstrip()

N, Q = map(int, input().split())
S = input()
li = [0]*(N+1)

for i in range(N):
    if S[i:i+2] == 'AC':
        li[i+1] = li[i] + 1
    else:
        li[i+1] = li[i]

for i in range(Q):
    l, r = map(int, input().split())
    print(li[r-1] - li[l-1])
Buggy python submission (verdict: Time Limit Exceeded):
A, B = map(int, input().split())
ans = A
for i in range(A+1, B+1):
    ans = ans ^ i
print(ans)

Fixed submission:
A, B = map(int, input().split())
def f(x):
    chk = x % 4
    if chk == 0:
        return x
    if chk == 1:
        return 1
    if chk == 2:
        return x + 1
    if chk == 3:
        return 0

if A != 0:
    A -= 1
print(f(A) ^ f(B))
Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
dp = [[0] * (W+1) for _ in range(N+1)]
for i in range(N):
    w, v = map(int, input().split())
    for w_lim in range(W+1):
        if w <= w_lim:
            dp[i+1][w_lim] = max(dp[i][w_lim-w]+v, dp[i][w_lim])
        else:
            dp[i+1][w_lim] = dp[i][w_lim]
print(dp[N][W])

Fixed submission:
N, W = map(int, input().split())
dp = [[0] * (W+1) for _ in range(N+1)]
for i in range(N):
    w, v = map(int, input().split())
    for w_lim in range(W+1):
        if w <= w_lim:
            dp[i+1][w_lim] = max(dp[i][w_lim-w]+v, dp[i][w_lim])
        else:
            dp[i+1][w_lim] = dp[i][w_lim]
print(dp[N][W])
Buggy python submission (verdict: Runtime Error):
N = int(input)
p = sorted([int(input()) for _ in range(N)], reverse=True)
ans = p[0] // 2 + sum(p[1:])
print(ans)

Fixed submission:
N = int(input())
p = sorted([int(input()) for _ in range(N)], reverse=True)
ans = p[0] // 2 + sum(p[1:])
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = sorted([int(input()) for _ in range(N)])
cum = [0] * (N-K+1)
for i in range(N-K+1):
    cum[i] = abs(H[i] - H[i+2])
print(sorted(cum)[0])

Fixed submission:
N, K = map(int, input().split())
H = sorted([int(input()) for _ in range(N)])
cum = [0] * (N-K+1)
for i in range(N-K+1):
    cum[i] = abs(H[i] - H[K+i-1])
print(min(cum))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = sorted([int(input()) for _ in range(N)])
cum = [0] * K
for i in range(N-K+1):
    cum[i] = abs(H[i] - H[i+2])
print(sorted(cum)[0])

Fixed submission:
N, K = map(int, input().split())
H = sorted([int(input()) for _ in range(N)])
cum = [0] * (N-K+1)
for i in range(N-K+1):
    cum[i] = abs(H[i] - H[K+i-1])
print(min(cum))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
if N == 1:
    print('Hello World')
else:
    print(A+B)

Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
else:
    print(int(input()) + int(input()))

Buggy python submission (verdict: Runtime Error):
N, A, B, = map(int, [int(input()) for _ in range(3)])
if N == 1:
    print('Hello World')
else:
    print(A+B)

Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
else:
    print(int(input()) + int(input()))
Buggy python submission (verdict: Runtime Error):
S = input()
if len(set(S)) == 1:
    print(S)
    exit()
for i in range(int(S), 1000):
    if len(set(i)) == 1:
        print(i)
        exit()

Fixed submission:
S = input()
if len(set(S)) == 1:
    print(S)
    exit()
for i in range(int(S), 1000):
    if len(set(str(i))) == 1:
        print(i)
        exit()
Buggy python submission (verdict: Runtime Error):
S, T = input(), input()
ma, ima = {}, {}
ok = True
for i in range(len(S)):
    s, t = S[i], T[i]
    if s in ma and ma[s] != t:
        ok = False
    if t in ima and ima[t] != s:
        ok = False
    ma[s] = t, ima[t] = s
if ok:
    print("Yes")
else:
    print("No")

Fixed submission:
S, T = input(), input()
ma, ima = {}, {}
ok = True
for i in range(len(S)):
    s, t = S[i], T[i]
    if s in ma and ma[s] != t:
        ok = False
    if t in ima and ima[t] != s:
        ok = False
    ma[s] = t
    ima[t] = s
if ok:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import fractions
N, X = map(int, input().split())
*x, = sorted(list(map(int, input().split())))
kyori = sorted([abs(X - xx) for xx in x])
print(fractions.gcd(kyori[0], kyori[1]))

Fixed submission:
import fractions
N, X = map(int, input().split())
*x, = [int(v) - X for v in input().split()]
chk = 0
for v in x:
    chk = fractions.gcd(chk, v)
print(abs(chk))
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
a = [list(map(int, input().split()))for _ in range(H)]
ans = []
for i in range(H):
    for j in range(W-1):
        if a[i][j] % 2 == 1:
            a[i][j] -= 1
            a[i][j+1] += 1
            ans.append([i, j, i, j+1])

w = W - 1
for i in range(H-1):
    if a[i][w] % 2 == 1:
        a[i][w] -= 1
        a[i+1][w] += 1
        ans.append([i, w, i+1, w])
print(len(ans))
for x in [list(map(lambda x: x+1, li)) for li in ans]:
    print(*x,)

Fixed submission:
H, W = map(int, input().split())
a = [list(map(int, input().split()))for _ in range(H)]
ans = []
for i in range(H):
    for j in range(W-1):
        if a[i][j] % 2 == 1:
            a[i][j] -= 1
            a[i][j+1] += 1
            ans.append([i, j, i, j+1])

w = W - 1
for i in range(H-1):
    if a[i][w] % 2 == 1:
        a[i][w] -= 1
        a[i+1][w] += 1
        ans.append([i, w, i+1, w])
print(len(ans))
aaaa = [list(map(lambda x: x+1, li)) for li in ans]
for x,y,z,a in aaaa:
    print(x, y, z, a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
import sys
sys.setrecursionlimit(100000)
dp = [-1] * (N + 1)
def rec(n):
    if n == 0:
        return 0
    if dp[n] != -1:
        return dp[n]
    res = n
    i = 0
    while n >= i ** 6:
        pow6 = i ** 6
        res = min(res, rec(n - pow6) + 1)
        i += 1

    j = 0
    while n >= j ** 9:
        pow9 = j ** 9
        res = min(res, rec(n - pow9) + 1)
        i += 1

    dp[n] = res
    return dp[n]
print(rec(N))

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
N = int(input())
dp = [-1] * (N + 1)

def rec(n):
    if n == 0:
        return 0
    if dp[n] != -1:
        return dp[n]
    res = n
    i = 0
    while n >= 6 ** i:
        pow6 = 6 ** i
        res = min(res, rec(n - pow6) + 1)
        i += 1
    j = 0
    while n >= 9 ** j:
        pow9 = 9 ** j
        res = min(res, rec(n - pow9) + 1)
        j += 1
    dp[n] = res
    return res
print(rec(N))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())
print(max(max(A+B, A-B), A*B))

Fixed submission:
A, B = map(int, input().split())
print(max([A+B, A-B, A*B]))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())
print(max(A+B, A-B, A*B))

Fixed submission:
A, B = map(int, input().split())
print(max([A+B, A-B, A*B]))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)
K = int(input())
cnt = {i: [] for i in range(N)}
for i in range(N):
    for j in range(N - i):
        s = S[j:j+i+1]
        idx = cnt[len(s)-1]
        if s not in idx:
            idx.append(s)
ttl = []
for k, v in cnt.items():
    ttl.extend(v)
ttl.sort()
print(ttl[K-1])

Fixed submission:
S = input()
N = len(S)
K = int(input())
cnt = {i: [] for i in range(N)}
for i in range(N):
    for j in range(N - i):
        s = S[j:j+i+1]
        l = len(s)
        if s not in cnt[l-1]:
            cnt[l-1].append(s)
    if i > K:
        break
ttl = []
for k, v in cnt.items():
    ttl.extend(v)
ttl.sort()
print(ttl[K-1])

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)
K = int(input())
cnt = {i: [] for i in range(N)}
for i in range(N):
    for j in range(N - i):
        s = S[j:j+i+1]
        l = len(s)
        if s not in cnt[l-1]:
            cnt[l-1].append(s)
ttl = []
for k, v in cnt.items():
    ttl.extend(v)
ttl.sort()
print(ttl[K-1])

Fixed submission:
S = input()
N = len(S)
K = int(input())
cnt = {i: [] for i in range(N)}
for i in range(N):
    for j in range(N - i):
        s = S[j:j+i+1]
        l = len(s)
        if s not in cnt[l-1]:
            cnt[l-1].append(s)
    if i > K:
        break
ttl = []
for k, v in cnt.items():
    ttl.extend(v)
ttl.sort()
print(ttl[K-1])
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left
N = int(input())
*A, = map(int, input().split())
A.sort()
m = A[-1]
x = m / 2
print(m, min(abs(x - A[bisect_left(A, x)]), abs(x - A[bisect_left(A, x) + 1])))

Fixed submission:
N = int(input())
*A, = map(int, input().split())
A.sort()
m = A[-1]
x = m / 2
ans = A[0]
for i in range(1, N-1):
    if abs(ans - x) > abs(A[i] - x):
        ans = A[i]
print(m, ans)
Buggy python submission (verdict: Runtime Error):
_ = input()
*S, = map(int, input().split())
l = len(set(S))
if l == 4:
    print("Four")
else:
    print("Three")

Fixed submission:
_ = input()
*S, = input().split()
l = len(set(S))
if l == 4:
    print("Four")
else:
    print("Three")
Buggy python submission (verdict: Runtime Error):
N = int(input())
*A, = map(int, input().split())
dic = {}
for a in A:
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1
for k, v in dic.items():
    if k == v:
        continue
    elif k > v:
        ans += v
    else:
        ans += v - k
print(ans)

Fixed submission:
N = int(input())
*A, = map(int, input().split())
dic = {}
ans = 0
for a in A:
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1
for k, v in dic.items():
    if k == v:
        continue
    elif k > v:
        ans += v
    else:
        ans += v - k
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print("Yes")
elif S[1] == S[2] and S[2] == S[3]:
  print("Yes)
else:
  print("No")

Fixed submission:
S = input()
if S[0] == S[1] and S[1] == S[2]:
    print("Yes")
elif S[1] == S[2] and S[2] == S[3]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
*A, = map(int, input().split())
*B, = map(int, input().split())
*C, = map(int, input().split())

ans = 0
for i in range(N):
    for j in range(N):
        if B[i] <= A[j]:
            continue
        for k in range(N):
            if B[i] < C[k]:
                ans += 1
print(ans)

Fixed submission:
from bisect import bisect_left, bisect_right
N = int(input())
*A, = map(int, input().split())
*B, = map(int, input().split())
*C, = map(int, input().split())
A.sort()
B.sort()
C.sort()
ans = 0
for b in B:
    a = bisect_left(A, b)
    c = bisect_right(C, b)
    ans += a * (N-c)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ans = 1
for _ in range(N):
  ans += min(ans*2, ans+K)
print(ans)

Fixed submission:
N = int(input())
K = int(input())
ans = 1
for _ in range(N):
  ans = min(ans*2, ans+K)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ans = 1
for _ in range(N):
  ans = min(ans*2, ans+K)
print(ans)

Fixed submission:
N = int(input())
K = int(input())
ans = 1
for _ in range(N):
  ans = min(ans*2, ans+K)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
*a, = map(int, input())
atai = math.ceil(sum(a) / n)
ans = 0
for x in a:
  if x == atai:
    pass
  else:
    ans += (x - atai) ** 2
print(ans)

Fixed submission:
n = int(input())
*a, = map(int, input().split())
atai = round(sum(a) / n)
ans = 0
for x in a:
    if x == atai:
        pass
    else:
        ans += (x - atai) ** 2
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

def dist(d1, d2):
    return abs(d1[0]-d2[0]) + abs(d1[1]-d2[1])

n = int(input())
list1 = np.zeros((n))
list2 = np.zeros((n))
xy_list = []
for i in range(n):
    x, y = map(int, input().split())
    xy_list.append([x, y])
    list1[i] = x+y
    list2[i] = x-y

num = np.zeros((4), dtype=int)
num[0] = np.argmax(list1)
num[1] = np.argmax(list2)
num[2] = np.argmin(list1)
num[3] = np.argmin(list2)

ans = 0
for d1 in range(4):
    for d2 in range(d1+1, 4):
        # print(num[d1], num[d2], dist(xy_list[num[d1]], xy_list[num[d2]]))
        ans = max(ans, dist(xy_list[num[d1]], xy_list[num[d2]]))

print(ans)

Fixed submission:
import numpy as np

def dist(d1, d2):
    return abs(d1[0]-d2[0]) + abs(d1[1]-d2[1])

n = int(input())
list1 = np.zeros((n))
list2 = np.zeros((n))
xy_list = []
for i in range(n):
    x, y = map(int, input().split())
    xy_list.append([x, y])
    list1[i] = x+y
    list2[i] = x-y

num = np.zeros((4), dtype=int)
num[0] = np.argmax(list1)
num[1] = np.argmax(list2)
num[2] = np.argmin(list1)
num[3] = np.argmin(list2)

ans = 0
for d1 in range(4):
    for d2 in range(d1+1, 4):
        # print(num[d1], num[d2], dist(xy_list[num[d1]], xy_list[num[d2]]))
        ans = max(ans, dist(xy_list[num[d1]], xy_list[num[d2]]))

print(ans)
Buggy python submission (verdict: Runtime Error):
i = int(input())
if i >= 30:
  print("Yes")
  else:
    print("No")

Fixed submission:
i = int(input())
if i >= 30:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
ans = 0
now = 7
while True:
    now = now % k
    if now == 0:
        print(ans+1)
        break
    else:
        ans += 1
        if now*10 + 7 % k == 0:
            print(-1)
            break
        else:
            now = now*10 + 7


Fixed submission:
k = int(input())
ans = 0
now = 7
if k == 1 or k == 7:
    now = 0
while True:
    if ans > k:
        print(-1)
        break
    elif now == 0:
        print(ans+1)
        break
    else:
        now = (now*10 + 7) % k
        ans += 1
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
count = 0
for i in len(s):
  if s[i] != t[i]:
    count += 1
    
print(count)


Fixed submission:
s = input()
t = input()
count = 0
for i in range(len(s)):
    if s[i] != t[i]:
        count += 1
    
print(count)