Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import math

sys.setrecursionlimit(1000000)

def main(): 

    N = int(input())
    A = list(map(int,input().split()))
    A_gcd_for=[]
    A_gcd_for.append(A[0])
    A_gcd_af=[]
    A_gcd_af.append(A[-1])
    for i in range(1,N):
        A_gcd_for.append(math.gcd(A_gcd_for[-1], A[i]))
        A_gcd_af.append(math.gcd(A_gcd_af[-1], A[N-i-1]))
    ans=0
    for i in range(N):
        if i==0: a = A_gcd_af[N-i-2]
        elif i==N-1: a = A_gcd_for[i-1]
        else: a = math.gcd(A_gcd_for[i-1], A_gcd_af[N-i-2])
        if a > ans:
            ans=a
    print(ans)

if __name__ == "__main__":
    main()
    

Fixed submission:
import sys
input = sys.stdin.readline
#import math
import fractions #fractions.gcd()
sys.setrecursionlimit(1000000)

def main(): 

    N = int(input())
    A = list(map(int,input().split()))
    A_gcd_for=[]
    A_gcd_for.append(A[0])
    A_gcd_af=[]
    A_gcd_af.append(A[-1])
    for i in range(1,N):
        A_gcd_for.append(fractions.gcd(A_gcd_for[-1], A[i]))
        A_gcd_af.append(fractions.gcd(A_gcd_af[-1], A[N-i-1]))
    ans=0
    for i in range(N):
        if i==0: a = A_gcd_af[N-i-2]
        elif i==N-1: a = A_gcd_for[i-1]
        else: a = fractions.gcd(A_gcd_for[i-1], A_gcd_af[N-i-2])
        if a > ans:
            ans=a
    print(ans)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

import heapq

def main(): 

    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()))
    
    AB = []
    for i in range(X):
        for j in range(Y):
            AB.append(A[i]+B[j])
    AB.sort(reverse=True)
    ABC=[]
    for i in range(min(K,len(AB))):
        for j in range(Z):
            ABC.append(AB[i]+C[j])
    ABC.sort(reverse=True)
    for i in range(K):
        print(ABC[i])


        


if __name__ == "__main__":
    main()
    

Fixed submission:
import sys
input = sys.stdin.readline

import heapq

def main(): 

    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()))
    
    AB = []
    for i in range(X):
        for j in range(Y):
            AB.append(A[i]+B[j])
    AB.sort(reverse=True)
    ABC=[]
    for i in range(min(K,len(AB))):
        for j in range(Z):
            ABC.append(AB[i]+C[j])
    ABC.sort(reverse=True)
    for i in range(K):
        print(ABC[i])


        


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

N, K = map(int,input().split())
td = [list(map(int, input().split())) for _ in range(N)]
td.sort(key=lambda x: (x[0],x[1]),reverse=True)

x= []
y= []
y.append(td[0][1])
for i in range(1,N):
    if td[i][0] != td[i-1][0]:
        y.append(td[i][1])
    else:
        x.append(td[i][1])
x.sort(reverse=True)
y.sort(reverse=True)
ans = 0
for i in range(1,min(K,len(y))+1):
    ans = max(ans, sum(y[:i])+sum(x[:max(0,K-i)])+i*i)
print(ans)


Fixed submission:
import sys
input = sys.stdin.readline

N, K = map(int,input().split())
td = [list(map(int, input().split())) for _ in range(N)]
td.sort(key=lambda x: (x[0],x[1]),reverse=True)

x= []
y= []
y.append(td[0][1])
for i in range(1,N):
    if td[i][0] != td[i-1][0]:
        y.append(td[i][1])
    else:
        x.append(td[i][1])
x.sort(reverse=True)
y.sort(reverse=True)
ans = 0
sum_y = 0
sum_x = []
tmp = 0
sum_x.append(0)
for i in range(len(x)):
    tmp += x[i]
    sum_x.append(tmp)

for i in range(1,min(K,len(y))+1):
    sum_y += y[i-1]
    if len(sum_x) < K-i+1: continue
    ans = max(ans, sum_y + sum_x[K-i] + i*i)
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

s = input().split() 
s = list(s[0])
t = input().split() 
t = list(t[0])

dp = [[0]*(len(t)+1) for _ in range(len(s)+1)]

for i in range(1,len(s)+1):
    for j in range(1,len(t)+1):
        if s[i-1]==t[j-1]:
            dp[i][j] = max(dp[i-1][j-1]+1,dp[i-1][j],dp[i][j-1])
        else:
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])
#print(dp[len(s)][len(t)])

ans = ""
i = len(s)
j = len(t)
while i>0 and j>0:
    if dp[i][j]==dp[i-1][j]:
        i-=1
    elif dp[i][j]==dp[i][j-1]:
        j-=1
    else:
        ans = s[i-1]+ans
        i-=1
        j-=1
print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

s = input().split() 
s = list(s[0])
t = input().split() 
t = list(t[0])

dp = [[0]*(len(t)+1) for _ in range(len(s)+1)]

for i in range(1,len(s)+1):
    for j in range(1,len(t)+1):
        if s[i-1]==t[j-1]:
            dp[i][j] = max(dp[i-1][j-1]+1,dp[i-1][j],dp[i][j-1])
        else:
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])
#print(dp[len(s)][len(t)])

ans = ""
i = len(s)
j = len(t)
while i>0 and j>0:
    if dp[i][j]==dp[i-1][j]:
        i-=1
    elif dp[i][j]==dp[i][j-1]:
        j-=1
    else:
        ans = s[i-1]+ans
        i-=1
        j-=1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N, T = map(int,input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
ans = 10000
for i in range(N):
    if cn[i][1] > T: continue
    ans = min(ans,cn[i][0])
print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

N, T = map(int,input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
INF = 100000
ans = INF
for i in range(N):
    if ct[i][1] > T: continue
    ans = min(ans,ct[i][0])
if ans == INF:
    ans="TLE"
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

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

for i in range(N, M+1):
    if M%i==0:
        print(M//i)
        break




Fixed submission:
import sys
input = sys.stdin.readline

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

yakusu = []

for i in range(1,int(M**0.5)+1):
    if M%i==0:
        yakusu.append(i)
        if M//i!=i:
            yakusu.append(M//i)
    
yakusu.sort()
for i in yakusu:
    if i>=N:
        print(M//i)
        break
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

import math

N,X=map(int,input().split())
x= list(map(int, input().split()))
x.append(X)
x.sort()
dis = []
for i in range(1, N+1):
    dis.append(x[i]-x[i-1])

tmp=dis[0]
for i in range(1,N):
    tmp = math.gcd(tmp,dis[i])
print(tmp)


Fixed submission:
import sys
input = sys.stdin.readline

import fractions

N,X=map(int,input().split())
x= list(map(int, input().split()))
x.append(X)
x.sort()
dis = []
for i in range(1, N+1):
    dis.append(x[i]-x[i-1])

tmp=dis[0]
for i in range(1,N):
    tmp = fractions.gcd(tmp,dis[i])
print(tmp)
Buggy python submission (verdict: Runtime Error):
row = list(map(int, input().split()))
s = [input().split() for i in range(row[0])]
for i in range(row[0]):
    s[i] = list(s[i][0])
dx = [0, -1, 1, 0]
dy = [-1, 0, 0, 1]
for i in range(row[0]):
    for j in range(row[1]):
        if s[i][j] == "#":
            Flag = False
            for d in range(4):
                nx = i + dx[d]
                ny = j + dy[d]
                if 0 <= nx < row[0] and 0<= ny < row[1]:
                    if s[nx][ny] == "#":
                        Flag = True
                        break
            if Flag != True:
                break
    if Flag != True:
        print("No")
        break
if Flag:
    print("Yes")



Fixed submission:
row = list(map(int, input().split()))
s = [input().split() for i in range(row[0])]
for i in range(row[0]):
    s[i] = list(s[i][0])
dx = [0, -1, 1, 0]
dy = [-1, 0, 0, 1]
Flag = True
for i in range(row[0]):
    for j in range(row[1]):
        if s[i][j] == "#":
            flag = False
            for d in range(4):
                nx = i + dx[d]
                ny = j + dy[d]
                if 0 <= nx < row[0] and 0<= ny < row[1]:
                    if s[nx][ny] == "#":
                        flag = True
                        break
            if flag == False:
                Flag = False
                break
    if Flag == False:
        print("No")
        break
if Flag:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
from collections import deque
H,W = list(map(int, input().split()))
s = [input().split() for i in range(H)]
for i in range(H):
    s[i] = list(s[i][0])
black = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            black += 1
queue = deque([])
dist = [[-1 for i in range(W)] for j in range(H)]
dist[0][0] = 0
queue.append([0,0])
place_w = [0, 1, 0, -1]
place_h = [1, 0, -1, 0]
Flag = False
while True:
    vh,vw = queue.popleft()
    for m in range(4):
        nvh = vh+place_h[m]
        nvw = vw+place_w[m]
        if 0<=nvh<H and 0<=nvw<W and dist[nvh][nvw] == -1 and s[nvh][nvw] == ".":
            queue.append([nvh,nvw])
            dist[nvh][nvw] = dist[vh][vw]+1
            if nvh == H-1 and nvw == W-1:
                Flag = True
                break
    if Flag:
        break
print(W*H-dist[H-1][W-1]-black-1)

Fixed submission:
from collections import deque
H,W = list(map(int, input().split()))
s = [input().split() for i in range(H)]
for i in range(H):
    s[i] = list(s[i][0])
black = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            black += 1
queue = deque([])
dist = [[-1 for i in range(W)] for j in range(H)]
dist[0][0] = 0
queue.append([0,0])
place_w = [0, 1, 0, -1]
place_h = [1, 0, -1, 0]
Flag = False
while len(queue) > 0:
    vh,vw = queue.popleft()
    for m in range(4):
        nvh = vh+place_h[m]
        nvw = vw+place_w[m]
        if 0<=nvh<H and 0<=nvw<W and dist[nvh][nvw] == -1 and s[nvh][nvw] == ".":
            queue.append([nvh,nvw])
            dist[nvh][nvw] = dist[vh][vw]+1
if dist[H-1][W-1] == -1:
    print(-1)
else:
    print(W*H-dist[H-1][W-1]-black-1)
Buggy python submission (verdict: Runtime Error):
ow = list(map(int, input().split()))
N = row[0]
Y = row[1]

order = []
order.append(int(Y/1e+4))
Y -= int(Y/1e+4) * 1e+4
order.append(int(Y/5e+3))
Y -= int(Y/5e+3) * 5e+3
order.append(int(Y/1e+3))
if sum(order) > N:
    print("-1 -1 -1")
else:
    print(order[0], order[1], order[2])

Fixed submission:
row = list(map(int, input().split()))
N = row[0]
Y = row[1]
Flag = 0
for x in range(N+1):
    for y in range(N+1):
        z = N - x - y
        if Y == x*10000 + y*5000 + z*1000 and z >= 0:
            print(x, y, z)
            Flag = 1
            break
    if Flag == 1:
        break
if Flag == 0:
    print(-1, -1, -1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))
a.sort()
i = 0
max_count = 0
count = 0
while i < len(a):
    x = a[i]
    j = i
    while j < len(a):
        if x == a[j] or x+1 == a[j] or x+2 == a[j]:
            count += 1
            j += 1
        else:
            break
    if max_count < count:
        max_count = count
    count = 0
    i += 1
print(max_count)


Fixed submission:
N = int(input())
a = list(map(int, input().split()))
a.sort()
max_count = 0
count = 0
i = 0
x_before = -1
while i < N:
    x = a[i]
    j = i
    if x_before != x:
        while j < len(a):
            if x == a[j] or x+1 == a[j] or x+2 == a[j]:
                count += 1
                j += 1
            else:
                break
        if max_count < count:
            max_count = count
    x_before = x
    count = 0
    i += 1
print(max_count)
Buggy python submission (verdict: Runtime Error):
row = list(map(int, input().split()))
Flag = False
for i in range(1000000):
    if row[0]*i % row[1] == row[2]:
        Flag = True
        break
if Flag:
    print("YES")
else:
    print("NO")

Fixed submission:
import sys
input = sys.stdin.readline

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

if A[-1]==B[0] and B[-1]==C[0]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
row = list(map(int, input().split()))
Flag = False
for i in range(10000000):
    if row[0]*i % row[1] == row[2]:
        Flag = True
        break
if Flag:
    print("YES")
else:
    print("NO")

Fixed submission:
row = list(map(int, input().split()))
Flag = False
for i in range(1000000):
    if row[0]*i % row[1] == row[2]:
        Flag = True
        break
if Flag:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
i = 0
sum_before = 0
sum_after = 0
count = 0
while i < n:
    sum_after = sum_before + a[i]
    if sum_after * sum_before > 0 or sum_after == 0:
        count += 1
        if sum_after < 0:
            a[i] += 1
        elif sum_after > 0:
            a[i] -= 1
        elif sum_before < 0:
            a[i] += 1
        else:
            a[i] -= 1
    else:
        i += 1
        sum_before = sum_after

print(count)
 




Fixed submission:
import numpy as np
import copy
n = int(input())
a = list(map(int, input().split()))
a_copy = copy.copy(a)
count = np.zeros(2)


i = 0
sum_before = 0
sum_after = 0    
    
if a[0] <= 0:
    count[0] += abs(a[0]) + 1
    a[0] = 1
while i < n:
    sum_after = sum_before + a[i]
    if sum_after * sum_before > 0 or sum_after == 0:
        if sum_after < 0:
            a[i] = a[i] - sum_after + 1
        elif sum_after > 0:
            a[i] = a[i] - sum_after - 1
        elif sum_before < 0:
            a[i] += 1
        else:
            a[i] -= 1
        count[0] += abs(sum_after) + 1
        sum_after = sum_before + a[i]
    i += 1
    sum_before = sum_after

i = 0
sum_before = 0
sum_after = 0    

if a_copy[0] >= 0:
    count[1] += abs(a_copy[0]) + 1
    a_copy[0] = -1

while i < n:
    sum_after = sum_before + a_copy[i]
    if sum_after * sum_before > 0 or sum_after == 0:
        if sum_after < 0:
            a_copy[i] = a_copy[i] - sum_after + 1
        elif sum_after > 0:
            a_copy[i] = a_copy[i] - sum_after - 1
        elif sum_before < 0:
            a_copy[i] += 1
        else:
            a_copy[i] -= 1
        count[1] += abs(sum_after) + 1
        sum_after = sum_before + a_copy[i]
    i += 1
    sum_before = sum_after

print(int(min(count[0], count[1])))
Buggy python submission (verdict: Runtime Error):
N,M=list(map(int,input().split()))
a = [list(map(int,input().split())) for i in range(M)]
seen = [-1 for i in range(N)]
count = 0
def dfs(x):
    global count
    if sum(seen) == N:
        count += 1
        return
    
    for i in range(M):
        if a[i][0] == x and seen[a[i][1]-1] == -1:
            seen[a[i][1]-1] = 1
            dfs(a[i][1])
            seen[a[i][1]-1] = -1
        if a[i][1] == x and seen[a[i][0]-1] == -1:
            seen[a[i][0]-1] = 1
            dfs(a[i][0])
            seen[a[i][0]-1] = -1
seen[0] = 1
dfs(1)
print(count)


Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int,input().split())
if N==1:
    N=14
if M==1:
    M=14
if N>M:
    print("Alice")
elif M>N:
    print("Bob")
else:
    print("Draw")
Buggy python submission (verdict: Time Limit Exceeded):
row = input().split()
K = int(row[0])
S = int(row[1])
count = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if S == x+y+z:
                count += 1

print(count)

Fixed submission:
row = input().split()
K = int(row[0])
S = int(row[1])
count = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= S - x - y <= K:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a,b= map(int,input().split())
c= a - b*2
if c > 0:
  print(c)
else:
  print 0

Fixed submission:
a,b= map(int,input().split())
c= a - b*2
if c > 0:
    print(c)
else:
    print (0)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n == 1:
  print(1)
elif n%2 == 0:
  print(0.5):
else:
  print(0.6)

Fixed submission:
a=0
n=int(input())
a+=n//2
if n%2 == 1:
    a+=1
print(a/n)
Buggy python submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
print([v[i]-c[i] if v[i]-c[i]>0 for i in range(n)])

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
a=0
for i in range(n):
    if v[i]>c[i]:
        a+=v[i]-c[i]
print(a)
Buggy python submission (verdict: Runtime Error):
n= int(input())
a=[]
c=1
for i in range(n):
    h=int(input().split)
    a.append(h)
d=a[0]
for b in range(n-1):
    if d <= a[b+1]:
        c+=1
    d=a[b+1]
print(c)

Fixed submission:
n= int(input())
h=list(map(int,input().split()))
b=1
a=h[0]
for i in range(n-1):
    if a <= h[i+1]:
        b+=1
        a=h[i+1]
print(b)

Buggy python submission (verdict: Runtime Error):
n= int(input())
a=[]
c=1
for i in range(n):
    h=int(input())
    a.append(h)
for b in range(n-1):
    if a[b] <= a[b+1]:
        c+=1
print(c)

Fixed submission:
n= int(input())
h=list(map(int,input().split()))
b=1
a=h[0]
for i in range(n-1):
    if a <= h[i+1]:
        b+=1
        a=h[i+1]
print(b)
Buggy python submission (verdict: Runtime Error):
import math
s=str(input())
b=''
c=0
d=math.ceil(len(s)/2)
if len(s) == 1:
    print(0)
elif s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
if len(s) != len(b):
    b = b[:-1]
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Fixed submission:
import math
s=str(input())
b=''
c=0
d=math.ceil(len(s)/2)
if s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
if len(s) != len(b):
    b = b[:-1]
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Buggy python submission (verdict: Runtime Error):
s=str(input())
b=''
c=0
d=int(round(len(s)/2))
if len(s) == 1:
    print(0)
elif s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
if len(s) != len(b):
    b = b[:-1]
    print(b)
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Fixed submission:
import math
s=str(input())
b=''
c=0
d=math.ceil(len(s)/2)
if s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
if len(s) != len(b):
    b = b[:-1]
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Buggy python submission (verdict: Runtime Error):
s=str(input())
a=0
b=''
c=0
d=round(int(len(s)/2))
if len(s) == 1:
    print(0)
elif len(s)%2 ==1:
    for v in range(d+1):
        if v < d and s[v+a]== '0':
            b+='01'
        elif v < d and s[v+a] =='1':
            b +='10'
        elif b[-1] == '0':
            b+= '1'
        else:
            b+= '0'
        a+=1
elif s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Fixed submission:
import math
s=str(input())
b=''
c=0
d=math.ceil(len(s)/2)
if s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
if len(s) != len(b):
    b = b[:-1]
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Buggy python submission (verdict: Runtime Error):
s=str(input())
a=[0]
b=''
c=0
d=int(len(s)/2)
if d == 0:
    print(0)
elif a=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Fixed submission:
import math
s=str(input())
b=''
c=0
d=math.ceil(len(s)/2)
if s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
if len(s) != len(b):
    b = b[:-1]
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Buggy python submission (verdict: Runtime Error):
s=str(input())
a=[0]
b=''
c=0
d=int(len(s)/2)
if a=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

Fixed submission:
import math
s=str(input())
b=''
c=0
d=math.ceil(len(s)/2)
if s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
if len(s) != len(b):
    b = b[:-1]
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
a=[]
for i in range(4):
    b=int(input())
    a.append(b)
c=int(input())
if a[0] - a[4] <= c:
    print('Yay!')
else:
    print(':(')

Fixed submission:
a=[]
for i in range(5):
    b=int(input())
    a.append(b)
c=int(input())
if a[4] - a[0] <= c:
    print('Yay!')
else:
    print(':(')

Buggy python submission (verdict: Runtime Error):
a=[]
for i in range(4):
    b=int(input())
    a.append(b)
c=int(input())
if max(a) - min(a) =< c:
    print('Yay!')
else:
    print(':(')

Fixed submission:
a=[]
for i in range(5):
    b=int(input())
    a.append(b)
c=int(input())
if a[4] - a[0] <= c:
    print('Yay!')
else:
    print(':(')
Buggy python submission (verdict: Runtime Error):
b=input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print(C)

Fixed submission:
b=input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print('C')

Buggy python submission (verdict: Runtime Error):
b=input()
if b == 'A':
    print('T')
    elif b == 'T':
        print('A')
        elif b == 'C':
            print('G')
            else:
                print(C)

Fixed submission:
b=input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print('C')
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
a=[]
c=[]
for i in range(n):
    b=int(input())
    a.append(b)
a.sort()
for u in range(n-2):
    d=a[u+k-1]-a[u]
    c.append(d)
print(min(c))

Fixed submission:
n,k = map(int,input().split())
a=[]
c=[]
for i in range(n):
    b=int(input())
    a.append(b)
a.sort()
for u in range(n-k+1):
    d=a[u+k-1]-a[u]
    c.append(d)
print(min(c))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split)
a=[]
c=[]
for i in range(n):
    b=int(input())
    a.append(b)
sorted(a)
for u in range(n-1):
    d=a[u+k-1]-a[u]
    c.append(d)
print(min(c))

Fixed submission:
n,k = map(int,input().split())
a=[]
c=[]
for i in range(n):
    b=int(input())
    a.append(b)
a.sort()
for u in range(n-k+1):
    d=a[u+k-1]-a[u]
    c.append(d)
print(min(c))
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n==3 or n==5 or n==7:


Fixed submission:
n = int(input())
if n==3 or n==5 or n==7:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
import sys

def solve(n):
    a = 0
    for s in str(n):
        a += int(s)
    if n%a == 0:
        return("Yes")
    else:
        return("No")

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a] = line.split(' ')
    return (int(str_a)

def main():
    a = readQuestion()
    answer = solve(a)
    print(answer)
    
if __name__ == '__main__':
    main()

Fixed submission:
import sys

def solve(n):
    a = 0
    for s in str(n):
        a += int(s)
    if n%a == 0:
        return("Yes")
    else:
        return("No")

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a] = line.split(' ')
    return (int(str_a))

def main():
    a = readQuestion()
    answer = solve(a)
    print(answer)
    
if __name__ == '__main__':
    main()