Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    pts = []
    m = 0
    while N != 0:
        x, y = map(int, input().split())
        for i in range(len(pts)):
            m = max(m, abs(pts[i][0] - x)+ abs(pts[i][1]-y))
        pts+= [[x,y]]
        N = N - 1
    print(m)

main()


Fixed submission:
def main():
    N = int(input())
    x, y = map(int, input().split())
    a1 = x + y
    a2 = x + y
    b1 = y - x
    b2 = y - x
    N -= 1
    while N != 0:
        x, y = map(int, input().split())
        a1 = max(a1, x + y)
        a2 = min(a2, x + y)
        b1 = max(b1, y - x)
        b2 = min(b2, y - x)
        N = N - 1
    print(max(a1 - a2, b1 - b2))

main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    pts = []
    while N != 0:
        x, y = map(int, input().split())
        pts+= [[x,y]]
        N = N - 1

    m = 0
    for i in range(0,len(pts)):
        for j in range(0,i):
            m = max(m, abs(pts[i][0]-pts[j][0]) + abs(pts[i][1] - pts[j][1]))
    print(m)

main()


Fixed submission:
def main():
    N = int(input())
    x, y = map(int, input().split())
    a1 = x + y
    a2 = x + y
    b1 = y - x
    b2 = y - x
    N -= 1
    while N != 0:
        x, y = map(int, input().split())
        a1 = max(a1, x + y)
        a2 = min(a2, x + y)
        b1 = max(b1, y - x)
        b2 = min(b2, y - x)
        N = N - 1
    print(max(a1 - a2, b1 - b2))

main()
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(input().split())
B = [int(a) for a in A]
x = 10**9+7
summation = 0
for i in range(N-1):
    for j in range(i+1,N):
        summation += (B[i] * B[j])
        summation % x
print(summation % x)

Fixed submission:
D, T, S = map(int, input().split())
if S*T >= D:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
D = []
for i in range(len(S) - len(T)):
    SS = S[i:i+len(T)]
    dif = 0
    for j in range(len(T)):
        if T[j] != SS[j]:
            dif += 1
    D += [dif]
            
print(min(D))


Fixed submission:
S = input()
T = input()
D = []
for i in range(len(S) - len(T) + 1):
    SS = S[i:i+len(T)]
    dif = 0
    for j in range(len(T)):
        if T[j] != SS[j]:
            dif += 1
    D += [dif]
            
print(min(D))

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
D = []
for i in range(len(S) - len(T)):
    SS = S[i:i+len(T)]
    dif = 0
    for j in range(len(T)):
        if T[j] != SS[j]:
            dif += 1
    D += [dif]
            
print(min(D))

Fixed submission:
S = input()
T = input()
D = []
for i in range(len(S) - len(T) + 1):
    SS = S[i:i+len(T)]
    dif = 0
    for j in range(len(T)):
        if T[j] != SS[j]:
            dif += 1
    D += [dif]
            
print(min(D))
Buggy python submission (verdict: Runtime Error):
N = input()

while len(N) > 1:
    M = sum(int(N[i]) for i in range(len(N)))
    N = str(M)

if M == 9 or M == 0:
    print('Yes')
else:
    print('No')


Fixed submission:
import math
N, X, T = map(int, input().split())

print(T * math.ceil(N / X))
Buggy python submission (verdict: Runtime Error):
N = input()

while len(N) > 1:
    M = sum(int(N[i]) for i in range(len(N)))
    N = str(M)

if M == 9:
    print('Yes')
else:
    print('No')



Fixed submission:
N = input()

if int(N) % 9 == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = input()

while len(N) > 1:
    M = sum(int(N[i]) for i in range(len(N)))
    N = str(M)

if M == 9 or M == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
N = input()

if int(N) % 9 == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = input()


while len(N) > 1:
    M = sum(int(N[i]) for i in range(len(N)))
    N = str(M)

if M == 9 or M == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
N = input()

if int(N) % 9 == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x, a = map(int. input().split())
print(0 if x < a else 10)

Fixed submission:
x, a = map(int, input().split())
print(0 if x < a else 10)
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0]
for li in l:
  d.append(d[-1] + li)
print(len([di for di in d if d <= x]))


Fixed submission:
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0]
for li in l:
  d.append(d[-1] + li)
print(len([di for di in d if di <= x]))
Buggy python submission (verdict: Runtime Error):
sheep = input()
wolves = input()

if sheep > wolves:
    print('safe')
else:
    print('unsafe')

Fixed submission:
import sys

sheep,wolves = (int(x) for x in input().split())

if sheep > wolves:
    print('safe')
else:
    print('unsafe')
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
ans = 0
for i in range(N):
    x, y = map(int, input().split())
    if x**2+y**2 <= D**2:
        ans += 1
print(ans)

Fixed submission:
import math
K = int(input())
if math.gcd(10, K) != 1:
    print(-1)
else:
    for i in range(1, 10**6+1):
        if 7*(pow(10, i, 9*K)-1) % (9*K) == 0:
            print(i)
            break
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))


def func(L):
    res = 0
    for x in A:
        result += (x-1)//L
    return res


l = 0
r = max(A)
while r-l > 1:
    M = (r+l)//2
    if case(M) >= K:
        l = M
    else:
        r = M
print(r)

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
def f(L):
    res=0
    for x in A:
        res+=(x-1)//L
    return res
l=0
r=max(A)
while r-l>1:
    M=(r+l)//2
    if f(M)>K:
        l=M
    else:
        r=M
print(r)
Buggy python submission (verdict: Runtime Error):
def solve():
    N=int(input())
    A=list(map(int,input().split()))
    mini,maxi=min(A),max(A)
    cnt=1000//mini
    print(maxi*cnt+1000%mini)
    
if __name__=="__main__"
    solve()
    

Fixed submission:
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    dp = [0 for j in range(N+1)]
    dp[0] = 1000
    for i in range(1, N+1):
        for j in range(i):
            dp[i] = max(dp[i], dp[j])
        for j in range(1, i):
            dp[i] = max(dp[i], dp[j] % A[j-1]+A[i-1]*(dp[j]//A[j-1]))
    ans = dp[N]
    print(ans)


if __name__ == "__main__":
    solve()
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
b = [0 for i in range(N+2)]
if K > 70:
    ans = [N for i in range(N)]
    print(*ans)
else:
    for _ in range(K):
        for i in range(N+2):
            b[i] = 0
        for i in range(N):
            b[max(0, i+1-a[i])] += 1
            b[min(N+1, i+1+a[i]+1)] -= 1
        for i in range(1, N+1):
            b[i] += b[i-1]
            a[i-1] = b[i]
    print(*a)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
b = [0 for i in range(N+2)]
if K > 70:
    ans = [N for i in range(N)]
    print(*ans)
else:
    for _ in range(K):
        for i in range(N+2):
            b[i] = 0
        for i in range(N):
            b[max(0, i+1-A[i])] += 1
            b[min(N+1, i+1+A[i]+1)] -= 1
        for i in range(1, N+1):
            b[i] += b[i-1]
            A[i-1] = b[i]
    print(*A)
Buggy python submission (verdict: Time Limit Exceeded):
# xor battle

def Normalize(A):
    A.sort(reverse=True)
    start_point = 0
    for i in range(60, -1, -1):
        X = 1 << i
        for j in range(start_point, len(A)):
            if A[j] >> i & 1:
                A[start_point], A[j] = A[j], A[start_point]
                for k in range(len(A)):
                    if A[k] >> i & 1 and k != start_point:
                        A[k] ^= A[start_point]
                start_point += 1
                break

# 最高位のbit を取得

def highest_bit(X):
    cnt = 0
    V = X
    while V & 1 == 0:
        cnt += 1
        V >>= 1
    return cnt


def solve():
    N = int(input())
    a = list(map(int, input().split()))
    player = input()

    p0, p1 = [], []

    for i in range(N):
        if player[i] == "0":
            p0.append(a[i])
        else:
            p1.append(a[i])
    Normalize(p0)
    Normalize(p1)

    for v in p0:
        bit = highest_bit(v)
        for j in range(len(p1)):
            if (v >> bit) & (p1[j] >> bit):
                p1[j] ^= v

    res = 0

    for x in p1:
        res ^= x

    print(res & 1)
    
    return


def main():
    T = int(input())
    for i in range(T):
        solve()
    return


if __name__ == "__main__":
    main()

Fixed submission:
# xor battle


def is_included(base, X):
    base.sort(reverse=True)
    V = X
    for x in base:
        V = min(V, V ^ x)
    return V


def solve():
    N = int(input())
    a = list(map(int, input().split()))[::-1]
    player = input()[::-1]
    basement = [0]
    for i in range(N):
        v = a[i]
        K = is_included(basement, v)
        if player[i] == "0":
            if K == 0:
                pass
            else:
                basement.append(K)
        else:
            if K == 0:
                pass
            else:
                return 1

    return 0


def main():
    T = int(input())
    for i in range(T):
        A = solve()
        print(A)
    return


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N,S=map(int,input().split())
A=list(map(int,input().split()))
dp=[[0 for i in range(3001)] for j in range(3001)]
#dp[X][S]=最後の物がX番目以下のもので、総和をSにしてくれる物の総数
dp[0][0]=1

mod=998244353

for i in range(N):
    w=A[i]
    for j in range(S+1):
        if j>=w:
            dp[i+1][j]+=(2*dp[i][j]+dp[i][j-w])
        else:
            dp[i+1][j]+=2*dp[i][j]
        dp[i+1][j]%=mod

print(dp[N][S]%mod)


Fixed submission:
N,S=map(int,input().split())
A=list(map(int,input().split()))
dp=[[0 for i in range(3001)] for j in range(3001)]
#dp[X][S]=最後の物がX番目以下のもので、総和をSにしてくれる物の総数
dp[0][0]=1

mod=998244353

for i in range(N):
    w=A[i]
    for j in range(S+1):
        if j>=w:
            dp[i+1][j]+=(2*dp[i][j]+dp[i][j-w])
        else:
            dp[i+1][j]+=2*dp[i][j]
        dp[i+1][j]%=mod

print(dp[N][S]%mod)
Buggy python submission (verdict: Runtime Error):
# LIS on Tree

from collections import deque
import bisect

N = int(input())
V = list(map(int, input().split()))
V.insert(0, 0)
visited = [False for i in range(N+1)]
inf = 10**18
dp = [inf for i in range(N+1)]
ans = [-1 for i in range(N+1)]
stack = deque()

G = [[] for i in range(N+1)]
for _ in range(N-1):
    u, v = map(int, input().split())
    G[u].append(v)
    G[v].append(u)


def dfs(s_node):
    visited[s_node] = True
    # dp値の更新
    value = V[s_node]
    index = bisect.bisect_left(dp, value)
    old_value = dp[index]
    dp[index] = value
    ans[s_node] = bisect.bisect_right(dp, inf-1)
    stack.append((index, old_value, value))
    for child in G[s_node]:
        if visited[child] == False:
            dfs(child)
    # 帰りがけにバックトラックを行う
    index, old_value, value = stack.pop()
    dp[index] = old_value


dfs(1)

for i in range(1, N+1):
    print(ans[i])

Fixed submission:
# LIS on Tree

from collections import deque
import bisect
import sys
sys.setrecursionlimit(10**7)

N = int(input())
V = list(map(int, input().split()))
V.insert(0, 0)
visited = [False for i in range(N+1)]
inf = 10**18
dp = [inf for i in range(N+1)]
ans = [-1 for i in range(N+1)]
stack = deque()

G = [[] for i in range(N+1)]
for _ in range(N-1):
    u, v = map(int, input().split())
    G[u].append(v)
    G[v].append(u)


def dfs(s_node):
    visited[s_node] = True
    # dp値の更新
    value = V[s_node]
    index = bisect.bisect_left(dp, value)
    old_value = dp[index]
    dp[index] = value
    ans[s_node] = bisect.bisect_right(dp, inf-1)
    stack.append((index, old_value, value))
    for child in G[s_node]:
        if visited[child] == False:
            dfs(child)
    # 帰りがけにバックトラックを行う
    index, old_value, value = stack.pop()
    dp[index] = old_value


dfs(1)

for i in range(1, N+1):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
from math import gcd
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            a=gcd(i,j)
            b=gcd(a,l)
            ans+=b
print(ans)


Fixed submission:
k=int(input())
from math import gcd
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            a=gcd(i,j)
            b=gcd(a,l)
            ans+=b
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=list(input())
ans=0
how_r=[0 for i in range(n+1)]
how_g=[0 for i in range(n+1)]
how_b=[0 for i in range(n+1)]
for i in range(n):
    string=s[i]
    if string=="R":
        how_r[i+1]+=1
    elif string=="G":
        how_g[i+1]+=1
    elif string=="B":
        how_b[i+1]+=1
for i in range(n):
    how_r[i+1]+=how_r[i]
    how_g[i+1]+=how_g[i]
    how_b[i+1]+=how_b[i]


for  i in range(n):
    for j in range(i+1,n):
        x=s[i]
        y=s[j]
        if x!=y:
            if "R" not in [x,y]:
                ans+=how_r[j+1]-how_r[i]
                if (i+j)%2==0:
                    if s[(i+j)//2]=="R":
                        ans-=1
                
            
            elif "G" not in [x,y]:
                ans+=how_g[j+1]-how_g[i]
                if (i+j)%2==0:
                    if s[(i+j)//2]=="G":
                        ans-=1
                
            elif "B" not in [x,y]:
                ans+=how_b[j+1]-how_b[i]
                if (i+j)%2==0:
                    if s[(i+j)//2]=="B":
                        ans-=1  
print(ans)

                
                
            
            
            
                            
                


Fixed submission:
def main():
    n=int(input())
    s=list(input())
    ans=0
    how_r=[0 for i in range(n+1)]
    how_g=[0 for i in range(n+1)]
    how_b=[0 for i in range(n+1)]
    for i in range(n):
        string=s[i]
        if string=="R":
            how_r[i+1]+=1
        elif string=="G":
            how_g[i+1]+=1
        elif string=="B":
            how_b[i+1]+=1
    for i in range(n):
        how_r[i+1]+=how_r[i]
        how_g[i+1]+=how_g[i]
        how_b[i+1]+=how_b[i]


    for  i in range(n):
        for j in range(i+1,n):
            x=s[i]
            y=s[j]
            if x!=y:
                if "R" not in [x,y]:
                    ans+=how_r[j+1]-how_r[i]
                    if (i+j)%2==0:
                        if s[(i+j)//2]=="R":
                            ans-=1

                elif "G" not in [x,y]:
                    ans+=how_g[j+1]-how_g[i]
                    if (i+j)%2==0:
                        if s[(i+j)//2]=="G":
                            ans-=1

                elif "B" not in [x,y]:
                    ans+=how_b[j+1]-how_b[i]
                    if (i+j)%2==0:
                        if s[(i+j)//2]=="B":
                            ans-=1  
    print(ans)
if __name__=="__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):

n,x,y=map(int,input().split())
graph={i:{} for i in range(1,n+1)}


#graphの隣接行列表示
for i in range(1,n):
    graph[i][i+1]=1
    graph[i+1][i]=1
    
graph[x][y]=1
graph[y][x]=1

#graph表示完成
import heapq
def dijkstra(s,graph,n):
    #ｓからのグラフの最短最短距離をまとめたデータを返す
    dist=[10**20 for i in range(n+1)]
    dist[s]=0
    pq=[]
    heapq.heapify(pq)
    #全ての接点を一度優先度付きキューに挿入する
    heapq.heappush(pq,(0,s))
    while pq:
        x=heapq.heappop(pq)
        node,mini_dis=x[1],x[0]
        for point in graph[node].keys():
            w=graph[node][point]
            #nodeからpointに対して伸びる辺の長さ
            newlen=dist[node]+w
            if newlen<dist[point]:
                heapq.heappush(pq,(newlen,point))
                dist[point]=newlen

    return dist

ans_dis=[0 for i in range(n)]

for i in range(1,n+1):
    sub=dijkstra(i,graph,n)
    for j in range(1,n+1):
        dis=sub[j]
        ans_dis[dis]+=1

for i in range(1,n):
    print(ans_dis[i]//2)
        




Fixed submission:
###############################################################
#ダイクストラ法
#計算量O(logV*(V+E)) （V=頂点の個数 E=辺の個数）
#辺の重みが負である場合には使えない
n,x,y=map(int,input().split())
graph={i:{} for i in range(1,n+1)}


#graphの隣接行列表示
for i in range(1,n):
    graph[i][i+1]=1
    graph[i+1][i]=1
    
graph[x][y]=1
graph[y][x]=1

#graph表示完成
import heapq
def dijkstra(s,graph,n):
    #ｓからのグラフの最短最短距離をまとめたデータを返す
    dist=[10**20 for i in range(n+1)]
    dist[s]=0
    pq=[]
    heapq.heapify(pq)
    #全ての接点を一度優先度付きキューに挿入する
    heapq.heappush(pq,(0,s))
    while pq:
        x=heapq.heappop(pq)
        node,mini_dis=x[1],x[0]
        for point in graph[node].keys():
            w=graph[node][point]
            #nodeからpointに対して伸びる辺の長さ
            newlen=dist[node]+w
            if newlen<dist[point]:
                heapq.heappush(pq,(newlen,point))
                dist[point]=newlen

    return dist

ans_dis=[0 for i in range(n)]

for i in range(1,n+1):
    sub=dijkstra(i,graph,n)
    for j in range(1,n+1):
        dis=sub[j]
        ans_dis[dis]+=1

for i in range(1,n):
    print(ans_dis[i]//2)
Buggy python submission (verdict: Runtime Error):
x,y,a,b,c=map(int,input().split())

a_list=list(map(int,input().split()))
a_list=sorted(a_list)
b_list=list(map(int,input().split()))
b_list=sorted(b_list)
a_list=a_list[-x:]
b_list=b_list[-y:]
c_list=list(map(int,input().split()))
for i in range(c):
    c_list[i]=-c_list[i]
import heapq
heapq.heapify(a_list)
heapq.heapify(b_list)
heapq.heapify(c_list)

flag=True
while flag and c_list:
    x=heapq.heappop(c_list)
    x=x*(-1)
    #ｃ_listの中でのもっとも大きい値
    min_a=heapq.heappop(a_list)
    min_b=heapq.heappop(b_list)
    if min(min_a,min_b)>=x:
        flag=False
        heapq.heappush(a_list,min_a)
        heapq.heappush(b_list,min_b)
    else:
        if min_a>=min_b:
            heapq.heappush(a_list,min_a)
            heapq.heappush(b_list,x)
         
        elif min_a<min_b:
            heapq.heappush(b_list,min_b)
            heapq.heappush(a_list,x)

sum_a=sum(list(a_list))
sum_b=sum(list(b_list))

print(sum_a+sum_b)
            

    



Fixed submission:

x,y,a,b,c=map(int,input().split())

a_list=list(map(int,input().split()))
a_list=sorted(a_list)
b_list=list(map(int,input().split()))
b_list=sorted(b_list)
a_list=a_list[-x:]
b_list=b_list[-y:]
c_list=list(map(int,input().split()))
for i in range(c):
    c_list[i]=-c_list[i]
import heapq
heapq.heapify(a_list)
heapq.heapify(b_list)
heapq.heapify(c_list)

flag=True
while flag and c_list:
    x=heapq.heappop(c_list)
    x=x*(-1)
    #ｃ_listの中でのもっとも大きい値
    min_a=heapq.heappop(a_list)
    min_b=heapq.heappop(b_list)
    if min(min_a,min_b)>=x:
        flag=False
        heapq.heappush(a_list,min_a)
        heapq.heappush(b_list,min_b)
    else:
        if min_a>=min_b:
            heapq.heappush(a_list,min_a)
            heapq.heappush(b_list,x)
         
        elif min_a<min_b:
            heapq.heappush(b_list,min_b)
            heapq.heappush(a_list,x)

sum_a=sum(list(a_list))
sum_b=sum(list(b_list))

print(sum_a+sum_b)
Buggy python submission (verdict: Runtime Error):
print(int(input())**3/27)

Fixed submission:
s=list(input())
n=len(s)
flag1=True
flag2=True

b=s[:(n-1)//2]
c=s[(n+1)//2:]

if b==b[::-1] and c==c[::-1] and s==s[::-1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
##!/usr/bin/env python
## -*- coding: utf-8 -*-
#import sys
#import os
#f = open('input.txt', 'r')
#sys.stdin = f
#input = sys.stdin.readline
# A　range flip find route

h, w = map(int, input().split())

dp = [[0 for i in range(w)] for j in range(h)]

maze = []
for i in range(h):
    sub = list(input())[:-1]
    maze.append(sub)

if maze[0][0] == "#":
    dp[0][0] = 1
for i in range(1, w):
    if maze[0][i - 1] == "." and maze[0][i] == "#":
        dp[0][i] = dp[0][i - 1] + 1

    else:
        dp[0][i] = dp[0][i - 1]
for j in range(1, h):
    if maze[j - 1][0] == "." and maze[j][0] == "#":
        dp[j][0] = dp[j - 1][0] + 1
    else:
        dp[j][0] = dp[j - 1][0]

for i in range(1, h):
    for j in range(1, w):
        d = dp[i - 1][j]
        e = dp[i][j - 1]
        if maze[i - 1][j] == "." and maze[i][j] == "#":
            d += 1
        if maze[i][j - 1] == "." and maze[i][j] == "#":
            e += 1
        dp[i][j] = min(d, e)
print(dp[h - 1][w - 1])


Fixed submission:
##!/usr/bin/env python
## -*- coding: utf-8 -*-
#import sys
#import os
#f = open('input.txt', 'r')
#sys.stdin = f
#input = sys.stdin.readline
# A　range flip find route

h, w = map(int, input().split())

dp = [[0 for i in range(w)] for j in range(h)]

maze = []
for i in range(h):
    sub = list(input())
    maze.append(sub)

if maze[0][0] == "#":
    dp[0][0] = 1
for i in range(1, w):
    if maze[0][i - 1] == "." and maze[0][i] == "#":
        dp[0][i] = dp[0][i - 1] + 1

    else:
        dp[0][i] = dp[0][i - 1]
for j in range(1, h):
    if maze[j - 1][0] == "." and maze[j][0] == "#":
        dp[j][0] = dp[j - 1][0] + 1
    else:
        dp[j][0] = dp[j - 1][0]

for i in range(1, h):
    for j in range(1, w):
        d = dp[i - 1][j]
        e = dp[i][j - 1]
        if maze[i - 1][j] == "." and maze[i][j] == "#":
            d += 1
        if maze[i][j - 1] == "." and maze[i][j] == "#":
            e += 1
        dp[i][j] = min(d, e)
print(dp[h - 1][w - 1])
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if c>=ab and a*b*4<(c-a*b)**2:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c=map(int,input().split())
if c>=a+b and a*b*4<(c-a-b)**2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
from collections import deque
d=deque()
e=deque()
d.append("a")

alpha=list("abcdefghijklmnopqrstuvwxyz")
dic={alpha[i]:i for i in range(26)}
for i in range(n-1):
    while d:
        x=d.popleft()
 
        for j in range(dic[(x[-1])]+2):
            e.append(x+alpha[int(j)])  
    d=e.copy()
    e=deque()
d=list(d)

if n==1:
    print("a")
else:
    d=sorted(d)
    for some in d:
        print(some)

Fixed submission:
n=int(input())
from collections import deque
d=deque()
e=deque()
d.append(("a",0))

alpha=list("abcdefghijklmnopqrstuvwxyz")
dic={alpha[i]:i for i in range(26)}
for i in range(n-1):
    while d:
        x,y=d.popleft() 
        for j in range(y+2):
            e.append((x+alpha[int(j)],max(y,j)))
    d=e
    e=deque()
d=list(d)
if n==1:
    print("a")
else:
    d=sorted(d,key=lambda x:x[0])
    for some in d:
        print(some[0])

Buggy python submission (verdict: Runtime Error):
n=int(input())
from collections import deque
d=deque()
e=deque()
d.append("a")

alpha=list("abcdefghijklmnopqrstuvwxyz")
dic={alpha[i]:i for i in range(26)}
for i in range(n-1):
    while d:
        x=d.popleft()
 
        for j in range(dic[(x[-1])]+2):
            e.append(x+alpha[int(j)])  
    d=e.copy()
    e=deque()
d=list(d)

if n==1:
    print("a")
else:
    for some in d:
        print(some)

Fixed submission:
n=int(input())
from collections import deque
d=deque()
e=deque()
d.append(("a",0))

alpha=list("abcdefghijklmnopqrstuvwxyz")
dic={alpha[i]:i for i in range(26)}
for i in range(n-1):
    while d:
        x,y=d.popleft() 
        for j in range(y+2):
            e.append((x+alpha[int(j)],max(y,j)))
    d=e
    e=deque()
d=list(d)
if n==1:
    print("a")
else:
    d=sorted(d,key=lambda x:x[0])
    for some in d:
        print(some[0])