Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
from heapq import heappop, heappush

N,M = map(int, input().split())
edge = [[] for _ in range(N)]
for _ in range(M):
    a,b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
Q = int(input())
VDC = [[int(i) for i in input().split()] for _ in range(Q)]
VDC.reverse()

INF = 10 ** 3

color = [-1] * N

def dijkstra(n, d, c):
    dist = [INF] * N
    dist[n] = 0
    que = [(0, n)]

    while que:
        dv, v = heappop(que)
        if dist[v] < dv: continue

        if color[v] < 0: color[v] = c
        if d == dv: continue
        
        for w in edge[v]:
            if dist[w] > dv + 1:
                dist[w] = dv + 1
                heappush(que, (dist[w], w))

def main():
    for v,d,c in VDC:
        dijkstra(v-1, d, c)

    for c in color:
        print(max(c, 0))

if __name__ == "__main__":
    main()

Fixed submission:
# 写経AC
N,M = map(int, input().split())
edge = [[] for _ in range(N)]
for _ in range(M):
    a,b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
Q = int(input())
VDC = [[int(i) for i in input().split()] for _ in range(Q)]

for i in range(Q):
    VDC[i][0] -= 1

color = [0] * N
# dp[v][d]: 頂点vから距離dは塗装済みか
visited = [[False] * 11 for _ in range(N)]

for v,d,c in reversed(VDC):
    if visited[v][d]: # 既に塗装済み
        continue
    if color[v] == 0:
        color[v] = c
    for dist in range(d + 1):
        # 距離d以下は塗装済み
        visited[v][dist] = True
    
    q = [v]
    for t in range(d - 1, -1, -1):
        qq = []
        for v in q:
            for w in edge[v]:
                if visited[w][t]:
                    continue
                for dist in range(t + 1):
                    visited[w][dist] = True
                if color[w] == 0:
                    color[w] = c
                qq.append(w)
        q = qq

print(*color, sep="\n")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10 ** 7)

N = int(input())
edge = [[] for _ in range(N)]
for lose in range(1, N):
    win = int(input())
    edge[win - 1].append(lose)

def dfs(n):
    """ nを根とする木の深さ """
    if not edge[n]:
        return 0
    
    que = []
    for v in edge[n]:
        que.append(dfs(v))

    que.sort(reverse=True)
    
    res = 0
    for plus, depth in enumerate(que, 1):
        # 今までの深さ + どれくらい深くするか
        res = max(res, depth + plus)
    
    return res

print(dfs(0))

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 7)
from heapq import heappop, heappush

N = int(input())
edge = [[] for _ in range(N)]
for node in range(1, N):
    a = int(input())
    edge[a-1].append(node)

def dfs(n):
    if not edge[n]:
        return 0
    
    que = []
    for v in edge[n]:
        heappush(que, (-1) * dfs(v))

    ans = 0
    for i in range(len(edge[n])):
        ans = max(ans, (-1) * heappop(que) + i + 1)
    
    return ans

print(dfs(0))
Buggy python submission (verdict: Time Limit Exceeded):
aI, aO, _, aJ, aL, _, _ = map(int,input().split())

"""
aO -> +1
aI, aJ, aL -> +3
aI * 2 -> +2
aJ * 2 -> +2
aL * 2 -> +2
"""

ansK = aO
for IJL in range(min(aI,aJ,aL) + 1):
    K = aO
    K += IJL * 3
    K += ((aI - IJL) // 2) * 2
    K += ((aJ - IJL) // 2) * 2
    K += ((aL - IJL) // 2) * 2
    ansK = max(ansK, K)

print(ansK)

Fixed submission:
aI, aO, _, aJ, aL, _, _ = map(int,input().split())

"""
aO -> +1
aI, aJ, aL -> +3
aI * 2 -> +2
aJ * 2 -> +2
aL * 2 -> +2

aI, aJ, aLを2個作ると、
aI * 2, aJ * 2, aL * 2に分解できる
"""

# aI, aJ, aLを0個作る
ans0 = aO + (aI // 2 + aJ // 2 + aL // 2) * 2
# aI, aJ, aLを1個作る
if min(aI, aJ, aL) > 0:
    ans1 = aO + 3 + ((aI-1) // 2 + (aJ-1) // 2 + (aL-1) // 2) * 2
else:
    ans1 = 0
print(max(ans0, ans1))
Buggy python submission (verdict: Runtime Error):
total = 0

for _ in range(int(input()))
	list1 = list(map(int, input().split()))
	for ele in range(0, len(list1)):
		total = total + list1[ele]
	print(total-min(list1))

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

a=sorted(a,reverse=True)
if n==2:
    print(max(a))
    exit(0)

ans=a[0]
a=a[1:]
from math import floor

for i in range(n-2):
    index=floor(i/2)
    ans+=a[index]

print(ans)

Buggy python submission (verdict: Runtime Error):
for i in range(int(input())):
	a = list(map(int, input().split()))
	res = -1
	for i in a:
		res+=i
	print(res)

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

a=sorted(a,reverse=True)
if n==2:
    print(max(a))
    exit(0)

ans=a[0]
a=a[1:]
from math import floor

for i in range(n-2):
    index=floor(i/2)
    ans+=a[index]

print(ans)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    pass


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()
    
    
n = int(input())
a = list(map(int, input().split()))
for i in range(int(input())):
    x, y = map(int, input().split())
    for b in range(len(a)):
        if a[b] == x:
            a[b] = y
    print(sum(a))

    

Fixed submission:
s = str(input())
if s.isupper():
    print("A")
else:
    print('a')
Buggy python submission (verdict: Runtime Error):
i=int(input())
j,k=int(input()).split()
l=0
while True:
    if j<=l*i<=k:
        print("OK")
        break
    elif l*i>k:
        print("NG")
        break
    l+=1


Fixed submission:
i=int(input())
j,k=(int(x) for x in input().split())
l=0
while True:
    if j<=l*i<=k:
        print("OK")
        break
    elif l*i>k:
        print("NG")
        break
    l+=1

Buggy python submission (verdict: Runtime Error):
i=int(input())
j,k=int(input()),int(input())
l=0
while True:
    if j<=l*i<=k:
        print("OK")
        break
    elif l*i>k:
        print("NG")
        break
    l+=1

Fixed submission:
i=int(input())
j,k=(int(x) for x in input().split())
l=0
while True:
    if j<=l*i<=k:
        print("OK")
        break
    elif l*i>k:
        print("NG")
        break
    l+=1

Buggy python submission (verdict: Runtime Error):
i=input(int())
j,k=input(int())
for l in range(k+1)
  if j<=l*i<=k:
    break
    print("OK")
  else:
    print("NG")

Fixed submission:
i=int(input())
j,k=(int(x) for x in input().split())
l=0
while True:
    if j<=l*i<=k:
        print("OK")
        break
    elif l*i>k:
        print("NG")
        break
    l+=1
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

s = 0
for i in range(len(A)):
    for j in range(i + 1, len(A)):
        s += A[i] * A[j]

print(s % (10 ** 9 + 7))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
s = sum(A)

ans = 0
for i in range(N - 1):
    s -= A[i]
    ans += A[i] * s

print(ans % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]

tL = []
for i in range(D):
    tL.append(int(input()))

def cal():
    score = 0
    his = [0] * len(C)
    for i in range(D):
        t = tL[i]
        t -= 1
        his[t] = i + 1
        sat = 0
        for j in range(len(C)):
            sat += C[j] * (i - his[j] + 1)
        score += S[i][t] - sat
    return score

def search():
    d, q = map(int, input().split())
    tL[d - 1] = q
    return cal()
    
M = int(input())
for _ in range(M):
    print(search())

Fixed submission:
D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]

tL = []
for i in range(D):
    tL.append(S[i].index(max(S[i])) + 1)

for t in tL:
    print(t)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = list(map(int, input().split()))
n = len(p)
ans = 10 ** 9

for i in range(2 ** n):
    total = 0
    cnt = 0
    for j in range(n):
        if((i >> j) & 1):
            total += p[j]
            cnt += 1
    if cnt == K and ans > total:
        ans = total
print(ans)

Fixed submission:
N, K = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
print(sum(p[:K]))
Buggy python submission (verdict: Runtime Error):
import collections as cl
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

sum = 0
for i in range(N):
    sum += A[i]
dic = cl.Counter(A)

l = []
for _ in range(Q):
    b, c = map(int, input().split())
    x = dic[b]
    if x == None:
        continue
    if b < c:
        sum += (c - b) * x
    else:
        sum -= (b- c) * x
    l.append(sum)
    if c not in dic:
        dic[c] = dic.pop(b)
    else:
        dic[c] = dic.pop(b) + dic[c]

for s in l:
    print(s)

Fixed submission:
import collections as cl
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

sum = 0
for i in range(N):
    sum += A[i]
dic = cl.Counter(A)

l = []
for _ in range(Q):
    b, c = map(int, input().split())
    x = dic.get(b)
    if x == None:
        l.append(sum)
        continue
    if b < c:
        sum += (c - b) * x
    else:
        sum -= (b - c) * x
    l.append(sum)
    if c not in dic:
        dic[c] = dic.pop(b)
    else:
        dic[c] = dic.pop(b) + dic[c]

for s in l:
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
L = list(map(int, input().split()))
maxres = 0

for i in range(3):
    n = [1, 0, -1]
    if L[i] <= L[3]:
        maxres += L[i] * n[i]
        L[3] -= L[i]
    else:
        for j in range(L[3]):
            maxres += n[i]
            L[3] -= 1
print(maxres)

Fixed submission:
L = list(map(int, input().split()))
n = [1, 0, -1]
maxres = 0

for i in range(3):
    if L[3] == 0:
        break
    maxres += L[i] * n[i]
    L[3] -= L[i]
    #print(L[3])
    if L[3] < 0:
        maxres -= abs(L[3]) * n[i]
        break
print(maxres)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, W =map(int, input().split())
weight = [0] * 110
value = [0] * 110
dp = np.zeros(shape=(N + 1, W + 1), dtype = np.int64)
#dp = [[0] * (110) for _ in range(10010)]

for i in range(N):
    weight[i], value[i] = map(int, input().split())

for i in range(N):
    for w in range(W + 1):
        if(w >= weight[i]):
            dp[i + 1][w] = max(dp[i][w - weight[i]] + value[i], dp[i][w])
        else:
            dp[i + 1][w] = dp[i][w]
print(dp[N][W])

Fixed submission:
import numpy as np
N, W = map(int, input().split())
dp = np.zeros(W + 1, dtype = np.int64)

for _ in range(N):
    w,v = map(int, input().split())
    np.maximum(dp[w:], dp[:-w] + v, out=dp[w:])

print(dp[W])

Buggy python submission (verdict: Runtime Error):
N, W =map(int, input().split())
weight = [0] * 110
value = [0] * 110
dp = [[0] * (110) for _ in range(10010)]

for i in range(N):
    weight[i], value[i] = map(int, input().split())

for i in range(N):
    for w in range(W + 1):# <= を表現したいときは+1するとよいかも
        if(w >= weight[i]):
            dp[i + 1][w] = max(dp[i][w - weight[i]] + value[i], dp[i][w])
        else:
            dp[i + 1][w] = dp[i][w]
#print(weight[:N],value[:N])
print(dp[N][W])


Fixed submission:
import numpy as np
N, W = map(int, input().split())
dp = np.zeros(W + 1, dtype = np.int64)

for _ in range(N):
    w,v = map(int, input().split())
    np.maximum(dp[w:], dp[:-w] + v, out=dp[w:])

print(dp[W])
Buggy python submission (verdict: Runtime Error):
inp_ = input()
imp_list = imp_.spilt()
if inp_list[0] / inp_list[1] <= 80:
    print("Yes") 
else:
    print("No")

Fixed submission:
inp = input()
inp_list = inp.split()
inp_list = [int(i) for i in inp_list] 
if inp_list[0] / inp_list[1] <= inp_list[2]:
    print("Yes") 
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
inp_list = input().spilt()
if inp_list[0] / inp_list[1] <= 80:
    print("Yes") 
else:
    print("No")

Fixed submission:
inp = input()
inp_list = inp.split()
inp_list = [int(i) for i in inp_list] 
if inp_list[0] / inp_list[1] <= inp_list[2]:
    print("Yes") 
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
inp_list = input().spilt()
if (inp_list[0] / inp_list[1]) <= 80:
    print("Yes") 
else:
    print("No")

Fixed submission:
inp = input()
inp_list = inp.split()
inp_list = [int(i) for i in inp_list] 
if inp_list[0] / inp_list[1] <= inp_list[2]:
    print("Yes") 
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
an = list(map(int, input().split()))
dan=0
for i in range(n-1):
  while an[i]>an[i+1]:
    an[i+1]=an[i+1]+1
    #print(an[i])
    dan=dan+1
print(dan)

Fixed submission:
n=int(input())
an = list(map(int, input().split()))
dan=0
for i in range(n-1):
  if an[i]>an[i+1]:
    dan=dan+(an[i]-an[i+1])
    an[i+1]=an[i]
    
print(dan)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
an = list(map(int, input().split()))
dan=0
for i in range(n-1):
  while an[i]>an[i+1]:
    an[i+1]=an[i+1]+1
    #print(an[i])
    dan=dan+1
print(dan)

Fixed submission:
n=int(input())
an = list(map(int, input().split()))
dan=0
for i in range(n-1):
  if an[i]>an[i+1]:
    dan=dan+(an[i]-an[i+1])
    an[i+1]=an[i]
    
print(dan)
Buggy python submission (verdict: Time Limit Exceeded):
import math
sum=0
num=int(input())
for a in range(1,num+1):
  for b in range(1,num+1):
    for c in range(1,num+1):
      d=math.gcd(a,b)
      e=math.gcd(c,d)
      sum=sum+e
print(sum)

Fixed submission:
import math
sum=0
num=int(input())
for a in range(1,num+1):
  for b in range(1,num+1):
    for c in range(1,num+1):
      d=math.gcd(a,b)
      e=math.gcd(c,d)
      sum=sum+e
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    k=2*j-i
    if k<=num-1:
      if word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)
  
      

Fixed submission:
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    k=2*j-i
    if k<=num-1:
      if word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)

Buggy python submission (verdict: Time Limit Exceeded):
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    for k in range(j+1,num):
      if k-j==j-i and word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)

Fixed submission:
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    k=2*j-i
    if k<=num-1:
      if word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)

Buggy python submission (verdict: Time Limit Exceeded):
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    for k in range(j+1,num):
      if k-j==j-i and word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)

Fixed submission:
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    k=2*j-i
    if k<=num-1:
      if word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)

Buggy python submission (verdict: Time Limit Exceeded):
num=int(input())
s=input()
count=0
for a in range(num-2):
  for b in range(a+1,num-1):
    for c in range(b+1,num):
      if (s[a]!=s[b] and s[b]!=s[c] and s[a]!=s[c]) and c-b!=b-a:
        count=count+1
print(count)

Fixed submission:
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    k=2*j-i
    if k<=num-1:
      if word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)

Buggy python submission (verdict: Time Limit Exceeded):
num=int(input())
s=input()
count=0
for a in range(num-2):
  for b in range(a+1,num-1):
    for c in range(b+1,num):
      if (s[a]!=s[b] and s[b]!=s[c] and s[a]!=s[c]) and c-b!=b-a:
        count=count+1
print(count)


Fixed submission:
num=int(input())
word=input()
alound=word.count("R")*word.count("G")*word.count("B")
for i in range(num-2):
  for j in range(i+1,num-1):
    k=2*j-i
    if k<=num-1:
      if word[i]!=word[j] and word[i]!=word[k] and word[k]!=word[j]:
        alound=alound-1
print(alound)
Buggy python submission (verdict: Time Limit Exceeded):
num=int(input())
count=0
num1=1
while count!=num:
  num2=str(num1)
  flag=0
  if len(num2)==1:
    ans=num1
    count=count+1
  else:
    for j in range(len(num2)-1):
      if abs(int(num2[j])-int(num2[j+1]))>=2:
        flag=1
        break
      else :
        continue
    if flag==0:
      ans=num1
      count=count+1
  num1=num1+1
print(ans)
      
      
    

Fixed submission:
import queue
num=int(input())
q=queue.Queue()
for i in range(1,10):
  q.put(i)
for j in range(num):
  ans=q.get()
  if ans%10!=0:
    q.put(10*ans+(ans%10)-1)
  q.put(10*ans+(ans%10))
  if ans%10!=9:
    q.put(10*ans+(ans%10)+1)
print(ans)
Buggy python submission (verdict: Runtime Error):
S = str(input())
T = str(input())
tempcount = 0
mincount = 0

if S in T:
    print("0")
    exit

for i in range(len(S) - len(T)+1):
    for j in range(len(T)):
        if S[i + j] != T[j]:
            tempcount += 1
    if i == 0:
        mincount = tempcount
    elif tempcount < mincount:
        mincount = tempcount
    tempcount = 0
    
print(mincount)



Fixed submission:
D,T,S=map(int,input().split())
Max = 0

if D/S<=T:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = str(input())
T = str(input())
tempcount = 0
mincount = 0

if S in T:
    print("0")
    exit

for i in range(len(S) - len(T)+1):
    for j in range(len(T)+1):
        if S[i + j] != T[j]:
            tempcount += 1
    if i == 0:
        mincount = tempcount
    elif tempcount < mincount:
        mincount = tempcount
    tempcount = 0
    
print(mincount)



Fixed submission:
S = str(input())
T = str(input())
tempcount = 0
mincount = 0

for i in range(len(S) - len(T)+1):
    for j in range(len(T)):
        if S[i + j] != T[j]:
            tempcount += 1
    if i == 0:
        mincount = tempcount
    elif tempcount < mincount:
        mincount = tempcount
    tempcount = 0
    
print(mincount)
Buggy python submission (verdict: Runtime Error):
try:
	N, M = map(int,input().split())
	for i in range(1, N+1):
    	f = 2 * i + 4 * (N - i)
    	if f == M:
       		print("Yes")
        	break
	else:
    	print("No")
except EOFError as error:

Fixed submission:
X,Y=map(int,input().split())
m=(4*X-Y)/2
n=(Y-2*X)/2
if (m.is_integer() and m >=0 ) and (n.is_integer() and n>=0):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
D=abs(a-b)
if t>=D/(v-w):
  print("YES")
else:
  print("NO")

Fixed submission:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
 
point_div = abs(a-b)
speed_div = v-w
if speed_div * t >= point_div:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
AV = input().split()
A,V = int(AV[0]), int(AV[1])
BW = input().split()
B,W = int(BW[0]), int(BW[1])
T = int(input())
while True:
    if A+V*T==B+W*T:
        print("YES")
    elif A+V*T=!B+W*T:
        print("NO")
    else:
        break

Fixed submission:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
 
point_div = abs(a-b)
speed_div = v-w
if speed_div * t >= point_div:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
AV = input().split()
A,V = int(AV[0]), int(AV[1])
BW = input().split()
B,W = int(BW[0]), int(BW[1])
T = int(input())
while True:
    if A+V*T==B+W*T:
        print("YES")
    elif (A+V*T<B+W*T)or(A+V*T>B+W*T):
        print("NO")
    else:
        break

Fixed submission:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
 
point_div = abs(a-b)
speed_div = v-w
if speed_div * t >= point_div:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
 
for x in range(N + 1):
    for y in range(N + 1- x):
        if 10000 * x + 5000 * y + 1000 * (N - x - y) == Y:
            print(x,y,z)
            exit()
print('-1 -1 -1')

Fixed submission:
N, Y = map(int, input().split())
 
for x in range(N + 1):
    for y in range(N + 1- x):
        z=N - x - y
        if 10000 * x + 5000 * y + 1000 * z == Y:
            print(x,y,z)
            exit()
print('-1 -1 -1')

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
 
for x in range (N+1):
  for y in range (N+1-x):
    z=N-x-y
    if 10000*x+5000*y+1000*z==Y:
    	print(x,y,z)
        exit()
print(-1,-1,-1)
        

Fixed submission:
N, Y = map(int, input().split())
 
for x in range(N + 1):
    for y in range(N + 1- x):
        z=N - x - y
        if 10000 * x + 5000 * y + 1000 * z == Y:
            print(x,y,z)
            exit()
print('-1 -1 -1')