Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K=map(int,input().split())
for i in range(A,B+1):
  if i<A+K or B-K<i:
    print(i)    

Fixed submission:
A,B,K=map(int,input().split())
if A+K-1<B-K+1:
  for i in range(A,A+K):
    print(i)
  for i in range(B-K+1,B+1):
    print(i)
else:
  for i in range(A,B+1):
    print(i)
Buggy python submission (verdict: Runtime Error):
if Y=n:
    z=n-1
    X＞n+(n-1)=2n-1
    これを満たすnが求める人数

Fixed submission:
X,Y,Z=map(int,input().split())
ans=X//(Y+Z)
if X<ans*(Y+Z)+Z:
  print(ans-1)
else:  
  print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
K=int(input())
list1=list(input())
SUM=0
for i in range(N):
  x=int(list1[i])
  if x>K-x:
    SUM+=2*(K-x)
  else:
    SUM+=2*x
print(SUM)    

Fixed submission:
N=int(input())
K=int(input())
SUM=0
list1=list(map(int,input().split()))
for i in range(N):
  x=list1[i]
  if x>K-x:
    SUM+=2*(K-x)
  else:
    SUM+=2*(x)
print(SUM)
Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  S+=[s]
ANS=[]
if n==1:
  ANS=S[0]
  ANS.sort()
  ans="".join(ANS) 
  print(ans)
  sys.exit()
for k in range(len(S[0])):
  if S[0][k] in S[1]:
    ANS+=[S[0][k]]
    S[1].remove(S[0][k])
for i in ANS:
  flag=0
  rem=[]
  for k in range(2,n):
    if i in S[k]:
      S[k].remove(i)
    elif flag!=1:
      rem+=[i]
      flag=1
for i in rem:
  ANS.remove[i]
ANS.sort()      
ans="".join(ANS)  
print(ans)

Fixed submission:
import sys
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  S+=[s]
ANS=[]
if n==1:
  ANS=S[0]
  ANS.sort()
  ans="".join(ANS) 
  print(ans)
  sys.exit()
for k in range(len(S[0])):
  if S[0][k] in S[1]:
    ANS+=[S[0][k]]
    S[1].remove(S[0][k])
rem=[]
for i in ANS:
  flag=0
  for k in range(2,n):
    if i in S[k]:
      S[k].remove(i)
    elif flag!=1:
      rem+=[i]
      flag=1
for i in rem:
  ANS.remove(i)
ANS.sort()      
ans="".join(ANS)  
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  S+=[s]
ANS=[]
for k in range(len(S[0])):
  if S[0][k] in S[1]:
    ANS+=[S[0][k]]
    S[1].remove(S[0][k])
for i in ANS:
  for k in range(2,n):
    if i in S[k]:
      S[k].remove(i)
    else:
      ANS.remove(i)
      break
ANS.sort()      
ans="".join(ANS)  
print(ans)

Fixed submission:
import sys
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  S+=[s]
ANS=[]
if n==1:
  ANS=S[0]
  ANS.sort()
  ans="".join(ANS) 
  print(ans)
  sys.exit()
for k in range(len(S[0])):
  if S[0][k] in S[1]:
    ANS+=[S[0][k]]
    S[1].remove(S[0][k])
rem=[]
for i in ANS:
  flag=0
  for k in range(2,n):
    if i in S[k]:
      S[k].remove(i)
    elif flag!=1:
      rem+=[i]
      flag=1
for i in rem:
  ANS.remove(i)
ANS.sort()      
ans="".join(ANS)  
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  S+=[s]
ANS=[]
for k in range(len(S[0])):
  if S[0][k] in S[1]:
    ANS+=[S[0][k]]
    S[1].remove(S[0][k])
for i in ANS:
  for k in range(2,n):
    if i in S[k]:
      S[k].remove(i)
    else:
      ANS.remove(i)      
ANS.sort()      
ans="".join(ANS)  
print(ans)

Fixed submission:
import sys
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  S+=[s]
ANS=[]
if n==1:
  ANS=S[0]
  ANS.sort()
  ans="".join(ANS) 
  print(ans)
  sys.exit()
for k in range(len(S[0])):
  if S[0][k] in S[1]:
    ANS+=[S[0][k]]
    S[1].remove(S[0][k])
rem=[]
for i in ANS:
  flag=0
  for k in range(2,n):
    if i in S[k]:
      S[k].remove(i)
    elif flag!=1:
      rem+=[i]
      flag=1
for i in rem:
  ANS.remove(i)
ANS.sort()      
ans="".join(ANS)  
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
MAX=max[a,b,c]
SUM=sum[a,b,c]
if MAX==SUM-MAX:
  print(Yes)
else:
  print(No)

Fixed submission:
a,b,c=map(int,input().split())
l=[a,b,c]
MAX=max(l)
SUM=sum(l)
if MAX==SUM-MAX:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
s = int(input()) 

dict={}
num_list = list(map(int, input().split()))

length=len(num_list)
count=[0]*(s+1000)
for i in range(length):
    count[num_list[i]]+=1
    dict[num_list[i]]=count[num_list[i]]
    
#print(dict)


sum=0
count=0
n = int(input()) 
for i in range(n):
    a,b = map(int, input().split())  
    if dict.get(a)!=None:
        if dict.get(b)!=None:
            count=dict[b]
            dict[b]=dict[a]+dict[b]
        else:
            dict[b]=dict[a]
        dict[a]=0
    else:
        pass
    #print(dict)
    for k, v in dict.items():
        sum+=k*v
    print(sum)
    sum=0

   


Fixed submission:
s = int(input()) 

dict={}
num_list = list(map(int, input().split()))

length=len(num_list)
count=[0]*(s+1000)
for i in range(length):
    count[num_list[i]]+=1
    dict[num_list[i]]=count[num_list[i]]
    
sum=0
#print(dict)
for k, v in dict.items():
    sum+=k*v
#print(dict)
#print(sum)

count=0
d=0
n = int(input()) 
for i in range(n):
    a,b = map(int, input().split())  
    if dict.get(a)!=None:
        d=(b-a)*dict[a]
        #print("d:{}".format(d))
        if dict.get(b)!=None:
            count=dict[b]
            dict[b]=dict[a]+dict[b]
        else:
            dict[b]=dict[a]
        dict[a]=0
        sum+=d
        
        #print(dict)
        
    else:
        pass
    d=0
    print(sum)
    #print()

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

dict={}
num_list = list(map(int, input().split()))

length=len(num_list)
count=[0]*(s+1)
for i in range(length):
    count[num_list[i]]+=1
    dict[num_list[i]]=count[num_list[i]]
    
#print(dict)


sum=0
count=0
n = int(input()) 
for i in range(n):
    a,b = map(int, input().split())  
    if dict.get(a)!=None:
        if dict.get(b)!=None:
            count=dict[b]
            dict[b]=dict[a]+dict[b]
        else:
            dict[b]=dict[a]
        dict[a]=0
    else:
        pass
    #print(dict)
    for k, v in dict.items():
        sum+=k*v
    print(sum)
    sum=0

   


Fixed submission:
s = int(input()) 

dict={}
num_list = list(map(int, input().split()))

length=len(num_list)
count=[0]*(s+1000)
for i in range(length):
    count[num_list[i]]+=1
    dict[num_list[i]]=count[num_list[i]]
    
sum=0
#print(dict)
for k, v in dict.items():
    sum+=k*v
#print(dict)
#print(sum)

count=0
d=0
n = int(input()) 
for i in range(n):
    a,b = map(int, input().split())  
    if dict.get(a)!=None:
        d=(b-a)*dict[a]
        #print("d:{}".format(d))
        if dict.get(b)!=None:
            count=dict[b]
            dict[b]=dict[a]+dict[b]
        else:
            dict[b]=dict[a]
        dict[a]=0
        sum+=d
        
        #print(dict)
        
    else:
        pass
    d=0
    print(sum)
    #print()
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
# coding: utf-8
# Your code here!
a,b = map(int, input().split()) 

if b==0:
    print(a)
    exit()
num_list = list(map(int, input().split()))

    

num=[True]*101
#print(num)


for i in range(b):
    num[num_list[i]]=False


num[0]=False
#print(num)

count=0
min_min=100
min_max=100
i=a

#print(i)
while 1:
    if i==100:
        break
    if num[i]==True:
        min_min=i-a
        break
    i+=1
j=a


while 1:
    if num[j]==True:
        min_max=a-j
        break
    j-=1
#print(min_max)
#print(j)
if min_min<min_max:
    print(i)
    
else:
    print(j)


Fixed submission:
x,y=map(int,input().strip().split())
nums = list(map(int, input().strip().split()))
ans=0
if y==0:
  print(x)
elif x not in nums:
  print(x)
else:
  for i in range(0,102):
    if i not in nums:
      if abs(x-i)<abs(x-ans):
        ans=i
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!

n = int(input())
num_list = list(map(int, input().split()))
sum=1

for i in num_list:
    if i==0:
        print(0)
        exit()
    i=str(i)
    sum=str(sum)
    
    i=int(i)
    sum=int(sum)
    sum=sum*i
    
if sum>10**18:
    print(-1)
    exit()
print(sum)


Fixed submission:
# coding: utf-8
# Your code here!

n = int(input())
num_list = list(map(int, input().split()))
sum=1

if 0 in num_list:
    print(0)
    exit()

for i in num_list:
    
    if i==0:
        print(0)
        exit()
    i=str(i)
    sum=str(sum)
    
    if len(i)+len(sum)>21:
        print(-1)
        exit()
    i=int(i)
    sum=int(sum)
    sum=sum*i
    if sum>10**18:
        print(-1)
        exit()
print(sum)
Buggy python submission (verdict: Runtime Error):
import math

a,b,c,d = map(float, input().split()) 

e=6*d
f=30*c+0.5*d

if e<f:
    kakudo=f-e
    
if kakudo>180:
    kakudo=360-kakudo

a2=a*a
b2=b*b
i=math.cos(math.radians(kakudo))
j=2*a*b*i
print(math.sqrt(a2+b2-j))


Fixed submission:

import math

a,b,c,d = map(float, input().split()) 

e=6*d
f=30*c+0.5*d

if e<f:
    kakudo=f-e
else:
    kakudo=e-f
    
if kakudo>180:
    kakudo=360-kakudo

a2=a*a
b2=b*b
i=math.cos(math.radians(kakudo))
j=2*a*b*i
print(math.sqrt(a2+b2-j))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
a,b = map(int, input().split())
count=[0]*a
for i in range(b):
    n = int(input())
    num_list = list(map(int, input().split())) 
    for j in num_list:
       count[j-1]+=1
c=0

for i in range(b):
    if count[i]==0:
        c+=1
print(c)

Fixed submission:
# coding: utf-8
a,b = map(int, input().split())
count=[0]*a
for i in range(b):
    n = int(input())
    num_list = list(map(int, input().split())) 
    for j in num_list:
       count[j-1]+=1
c=0

for i in range(a):
    if count[i]==0:
        c+=1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = [int(_) for _ in input().split()]



    result = 1
    for i in A:
        result = result * i

    if result > 1000000000000000000:
        print(-1)
    else:
        print(result)

if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    if 0 in A:
        print(0)
        return

    result = 1
    # count = 0
    for i in A:
        # l = len(str(i)) - 1
        # if l != 0:
        #     count = count + l
        result = result * i
        if result > 1000000000000000000:
            print(-1)
            return

    print(result)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = str(input())
    count = 0
    for i in range(1, len(N)):
        target = N[i]
        if target == 'W':
            for j in range(0, i):
                if N[j] == 'B':
                    count = count + 1
    print(count)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N = str(input())
    B_count = 0
    result = 0
    for i in range(0, len(N)):
        target = N[i]
        if target == 'W':
            result = result + B_count
        else:
            B_count = B_count + 1        
    print(result)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    D = [int(_) for _ in input().split()]
    M = int(input())
    T = [int(_) for _ in input().split()]

    if N < M:
        print("NO")
        return

    for i in range(M):
        target = T[i]
        if D.count(target) >= 1:
            D.remove(target)
        else:
            print("NO")
            return
    
    print("YES")


if __name__ == "__main__":
    main()

Fixed submission:
import collections

def main():
    N = int(input())
    D = [int(_) for _ in input().split()]
    M = int(input())
    T = [int(_) for _ in input().split()]
    Dd = collections.Counter(D)
 
    if N < M:
        print("NO")
        return

    for i in range(M):
        target = T[i]
        if Dd[target] >= 1:
            Dd[target] = Dd[target] - 1
        else:
            print("NO")
            return
    
    print("YES")


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    S = []
    for _ in range(N):
        S.append(int(input()))
    
    maxScore = 0
    for i in range(2 ** N):
        tmp = 0
        for j in range(N):
            if ((i >> j) & 1):
                tmp = tmp + S[j]
        if tmp % 10 == 0:
            tmp = 0
        if maxScore < tmp:
            maxScore = tmp
    
    print(maxScore)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N = int(input())
    S = []
    M = []
    sumsum = 0
    for _ in range(N):
        t = int(input())
        if t != 0:
            sumsum = sumsum + t
            S.append(t)
            if t % 10 != 0:
                M.append(t)

    if sumsum % 10 != 0:
        print(sumsum)
        return
    
    if len(M) == 0:
        print("0")
        return

    M.sort()
    print(sumsum - M[0])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
from collections import Counter 
n, a, b = map(int, input().split())
red = "r"*b
blue = "b"*a
k=""
while len(k) <= n:
    k += blue+red 
count = Counter(k[:n]) 
print(count['b'])

Fixed submission:
n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
qs = [input().split() for i in range(q)]

for operation in qs:
    if operation[0] == '1':
        s = s[::-1]
    elif operation[0] == '2':
        t , f, c = operation
        if f == '1':
            s = c+s
        else:
            s = s + c
print(s)

Fixed submission:
s = input()
q = int(input())
qs = [input().split() for i in range(q)]
n = False
left= right = ""
for operation in qs:
    if operation[0] == '1':
        n = not n
    if operation[0] == '2':
        t , f, c = operation
        f = int(f)
        if n:
            f = 1 if f != 1 else 2
        if f == 1:
            left=c+left
        elif f == 2:
            right+=c
s = left+s+right
print(s[::-1] if n else s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()

du = False
for i in range(n):
    for j in range(n):
        if a[i] == a[j] and i != j:
            du = True
print('YES' if not du else 'NO')

Fixed submission:
n = int(input())
a = input().split()
b = set(a)
if len(b)<len(a):
    print("NO")
else:
    print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
a = input().split()

def dup(listOfElems):
    for elem in listOfElems:
            if listOfElems.count(elem) > 1:
                return True
    return False

du = dup(a)
print('YES' if not du else 'NO')

Fixed submission:
n = int(input())
a = input().split()
b = set(a)
if len(b)<len(a):
    print("NO")
else:
    print("YES")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [input().split() for i in range(M)]
problems = {}
reject_count = 0
for P, S in A:
    if not problems.get(P) and P <= N:
        if S != 'AC':
            reject_count += 1
        else:
            problems[P] = S
print(len(problems), reject_count)

Fixed submission:
N, M = map(int, input().split())
A = [input().split() for i in range(M)]
problems = {}
rejected = [0]*(N+1)
reject_count = 0
for P, S in A:
    P = int(P)
    if not problems.get(P):
        if S != 'AC':
            rejected[P] += 1
        else:
            problems[P] = S
for i in range(N+1):
    if problems.get(i):
        reject_count += rejected[i]
print(len(problems), reject_count)
Buggy python submission (verdict: Runtime Error):
n1 = input()
n2 = input()
choices = [1,2,3]
choices.remove(n1)
choices.remove(n2)
print(choices[0])

Fixed submission:
n1 = int(input())
n2 = int(input())
choices = [1,2,3]
choices.remove(n1)
choices.remove(n2)
print(choices[0])

Buggy python submission (verdict: Runtime Error):
n1 = input()
n2 = input()
choices = [1,2,3]
choices.remove(n1)
choices.remove(n2)
print(choices[0])

Fixed submission:
n1 = int(input())
n2 = int(input())
choices = [1,2,3]
choices.remove(n1)
choices.remove(n2)
print(choices[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
print("bust" if n>=22 else "win" )

Fixed submission:
import functools
n = functools.reduce(lambda x,y: int(x)+int(y), input().split())
print("bust" if n>=22 else "win")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
sums=0
for j in range(n):
    q=0
    i=1
    while i*i<=j+1:
        if (j+1)%i==0:
            q=q+2
            if (j+1)//i==i:
                q=q-1
        i=i+1
    sums=sums+(j+1)*q
print(sums)      

Fixed submission:
n=int(input())
sums=0
i=1
while i<=n:
    m=n//i
    sums=sums+((m+1)/2*m)*i
    i=i+1
print(int(sums))
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
for i in range(-1000,1000):
    a=i
    for j in range(-1000,1000):
        b=j
        if a**5-b**5==x:
            am=a
            bm=b
        else:
            c=0
print(am,bm)

Fixed submission:
x=int(input())
for i in range(200):
    a=i
    for j in range(-200,i):
        b=j
        if a**5-b**5==x:
            am=a
            bm=b
        else:
            c=0
print(am,bm)

Buggy python submission (verdict: Runtime Error):
x=int(input())
for i in range(-100,100):
    a=i
    for j in range(-100,100):
        b=j
        if a**5-b**5==x:
            am=a
            bm=b
        else:
            c=0
print(am,bm)

Fixed submission:
x=int(input())
for i in range(200):
    a=i
    for j in range(-200,i):
        b=j
        if a**5-b**5==x:
            am=a
            bm=b
        else:
            c=0
print(am,bm)
Buggy python submission (verdict: Runtime Error):
a,b,n=map(int,input().split())
maxs=0
if a>=b:
    if n>=b:
        maxs=a/b*(b-1)-(a%b*(b-1))%b/b
    else:
        maxs=a/b*n-(a%b*n)%b/b
else:
    if n>=b:
        maxs=(a*(b-1))//b
    else:
        maxs=(a*n)//b
print(int(maxs))

Fixed submission:
k=int(input())
a,b=map(int,input().split())
if a%k==0:
    print('OK')
else:
    
    if a//k*k+k<=b:
        print('OK')
    else:
        print('NG')

Buggy python submission (verdict: Runtime Error):
a,b,n=map(int,input().split())
maxs=0
if a>=b:
    if n>=b:
        maxs=a/b*(b-1)-(a%b*(b-1))%b/b
    else:
        maxs=a/b*n-(a%b*n)%b/b
else:
    if n>=b:
        maxs={a*(b-1)}//b
    else:
        maxs={a*n}//b
print(int(maxs))

Fixed submission:
k=int(input())
a,b=map(int,input().split())
if a%k==0:
    print('OK')
else:
    
    if a//k*k+k<=b:
        print('OK')
    else:
        print('NG')
Buggy python submission (verdict: Time Limit Exceeded):
import math
k=int(input())
sums=0
for i in range(k):
    a=i+1
    for i in range(k):
        b=i+1
        for i in range(k):
            c=i+1
            d=math.gcd(a,b)
            sums=sums+math.gcd(c,d)
print(sums)

Fixed submission:
import math
k=int(input())
sums=0
for i in range(k):
    a=i+1
    for i in range(k):
        b=i+1
        d=math.gcd(a,b)
        for i in range(k):
            c=i+1
            
            sums=sums+math.gcd(c,d)
print(sums)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
while n>k:
    n=abs(n-k)
    
if n>abs(k-n):
    n=k-n
print(n)

Fixed submission:
n,k=map(int,input().split())
a=n%k
b=k-a
if a<b:
    print(a)
else:
    print(b)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
while 1:
    n=abs(n-k)
    
    if k>=n:
        break
if n>abs(k-n):
    n=k-n
print(n)

Fixed submission:
n,k=map(int,input().split())
a=n%k
b=k-a
if a<b:
    print(a)
else:
    print(b)
Buggy python submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=list(map(int,input().split()))
A=sorted(A)
A.append(A[0]+K)
i=0
b=0
for i in range(N):
    if b<A[i+1]-A[i]:
        b=A[i+1]-A[i]
print(K-b)

Fixed submission:
S=list(input())
print('Yes'if S[2]==S[3]and S[4]==S[5] else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
K,N=map(int,input().split())
A=list(map(int,input().split()))
A=sorted(A)
A.append(A[0]+K)
i=0
c=[]
for i in range(N):
    b=A[i+1]-A[i]
    c=c+[b]
print(K-max(c))


Fixed submission:
K,N=map(int,input().split())
A=list(map(int,input().split()))
A=sorted(A)
A.append(A[0]+K)
i=0
b=0
for i in range(N):
    if b<A[i+1]-A[i]:
        b=A[i+1]-A[i]
print(K-b)
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
P = [int(p) for p in input().split()]

is_exit = [False] * 101

for p in P:
    is_exit[p] = True

if not is_exit[X]:
    print(X)
else:
    l = X - 1
    r = X + 1
    while True:
        if not is_exit[l]:
            print(l)
            exit()
        if not is_exit[r]:
            print(r)
            exit()
        l -= 1
        r += 1


Fixed submission:
X, N = map(int, input().split())
P = [int(p) for p in input().split()]

is_exit = [False] * 101

for p in P:
    is_exit[p] = True

if not is_exit[X]:
    print(X)
else:
    l = X - 1
    r = X + 1
    while True:
        if 1 <= l:
            if not is_exit[l]:
                print(l)
                exit()
        else:
            print(l)
            exit()
        if r <= 100:
            if not is_exit[r]:
                print(r)
                exit()
        else:
            print(r)
            exit()
        l -= 1
        r += 1
Buggy python submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    print("NO")
    exit()

s = V - W
if D < s * T:
    print("YES")
else:
    print("NO")


Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    print("NO")
    exit()

d = abs(A - B)
s = V - W

if d <= s * T:
    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())

if V <= W:
    print("NO")
    exit()

s = V - W
if D < s * T:
    print("YES")
else:
    print("NO")

Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    print("NO")
    exit()

d = abs(A - B)
s = V - W

if d <= s * T:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import copy

N, K = map(int, input().split())
A = [int(i) for i in input().split()]

# imos法
# log(N)ぐらいで収束するので、打ち切れば計算量的には問題なし？

for i in range(K):
    B = [0] * (N+1)
    for j in range(N):
        l = max(0, j-A[j])
        r = min(j+A[j]+1, N)
        B[l] += 1
        B[r] -= 1
    # print("B: {}".format(B))
    for j in range(N):
        B[j+1] += B[j]
    del B[N]
    # print("B: {}".format(B))
    if A == B:
        break
    A = copy.deepcopy(B)

print(*A)


Fixed submission:
import copy

N, K = map(int, input().split())
A = [int(i) for i in input().split()]

# imos法
# log(N)ぐらいで収束するので、打ち切れば計算量的には問題なし？

for i in range(K):
    B = [0] * (N+1)
    for j in range(N):
        l = max(0, j-A[j])
        r = min(j+A[j]+1, N)
        B[l] += 1
        B[r] -= 1
    # print("B: {}".format(B))
    for j in range(N):
        B[j+1] += B[j]
    del B[N]
    # print("B: {}".format(B))
    if A == B:
        break
    A = copy.deepcopy(B)

print(*A)