Problem:


Score : 200 points

Problem Statement

Two children are playing tag on a number line. (In the game of tag, the child called "it" tries to catch the other child.) The child who is "it" is now at coordinate A, and he can travel the distance of V per second.
The other child is now at coordinate B, and she can travel the distance of W per second.

He can catch her when his coordinate is the same as hers.
Determine whether he can catch her within T seconds (including exactly T seconds later).
We assume that both children move optimally.

Constraints

-10^9 \leq A,B \leq 10^9

1 \leq V,W \leq 10^9

1 \leq  T \leq 10^9

A \neq B

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A V
B W
T

Output

If "it" can catch the other child, print YES; otherwise, print NO.

Sample Input 1

1 2
3 1
3

Sample Output 1

YES

Sample Input 2

1 2
3 2
3

Sample Output 2

NO

Sample Input 3

1 2
3 3
3

Sample Output 3

NO



Sample input:
1 2
3 1
3


Sample output:
YES

Submission status: Wrong Answer

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if A + V*T >= B + W*T:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, v = list(map(int,input().strip().split()))
b, w = list(map(int,input().strip().split()))
t = int(input())
ansa = a + v * t
ansb = b + w * t
if ansb <= ansa:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

A_ = A + V * T
B_ = B + W * T

if A_ >= B_:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
def main():
    a, v = map(int, input().split())
    b, w = map(int, input().split())
    t = int(input())
    if b + w*t <= a + v*t:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
D = B - A
if (V - W)*T >= T:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy


if __name__ == "__main__":
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())
    d = abs(b-a)
    vt = v*t
    wt = w*t
    a = a + vt
    b = b + wt
    if b <= a:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
A,V = [int(hoge) for hoge in input().split()]
B,W = [int(hoge) for hoge in input().split()]
T = int(input())
dist = abs(A-B)
oni = (V-W) * T
if dist <= oni:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if abs(a-v) < (v-w)*t:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    a, v = nm()
    b, w = nm()
    t = ni()
    if abs(a - b) < (v - w) * t:
        print('YES')
    else:
        print('NO')
    return

solve()

Submission status: Wrong Answer

Solution code:
#デフォルト
import itertools
from collections import defaultdict
import collections
import math
import sys
sys.setrecursionlimit(200000)
mod = 1000000007

a, v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())

if a == b:
    print("YES")
elif v > w:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if v <= w:
    print("NO")
elif abs(a-b) // abs(v-w) <= t:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
k = abs(a - b)
if v <= w:
    print('NO')
else:
    if t * (v - w) >= k:
        print('YES')

Submission status: Wrong Answer

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())

t = int(input())

d1 = a + v*t
d2 = b + w*t

if d2 <= d1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,V = map(int,input().split())
B,W = map(int,input().split())
T=int(input())

A+=V*T
B+=W*T

if A>=B:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if A+V*T >= B+W*T:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
def main():
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    cond = B + W * T <= A + V * T
    print('YES' if cond else 'NO')


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Wrong Answer

Solution code:
a, x = map(int,input().split())
b, y = map(int,input().split())
t = int(input())

if a+x*t >= b+y*t:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if a+v*t >= b+w*t:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
kyori = abs(a-b)
sa = v-w
if sa == 0:
	print("NO")
	exit()
if kyori//sa >= w:
	print("YES")
else:
	print("NO")

Submission status: Wrong Answer

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

if a+v*t >= b+w*t:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
def main():
    A, V = list(map(int, input().split()))
    B, W = list(map(int, input().split()))
    T = int(input())


    return A + V * T >= B + W * T

print('YES' if main() else 'NO')

Submission status: Time Limit Exceeded

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
ans = 'NO'
for i in range(t):
    if a < b:
        a += v
        b += w
    else:
        a -= v
        b -= w
    if a == b:
        ans = 'YES'
        break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
ans = 'NO'
for i in range(t):
    if a < b:
        a += v
        b += w
    else:
        a -= v
        b -= w
    if a == b:
        ans = 'YES'
        break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if v<w:
  print("NO")
  exit()
diff=abs(a-b)
for _ in range(t):
  diff=diff-v+w
  if diff<=0:
    print("YES")
    exit()
print("NO")

Submission status: Time Limit Exceeded

Solution code:
#! python3
# coding:utf-8

a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

for i in range(1,t+1):
    if a<b :
        a = a + v
        b = b + w
    elif a>b:
        a = a - v
        b = b - w
    if a == b:
        print("YES")
        exit()
print("NO")

Submission status: Time Limit Exceeded

Solution code:
c1 = input().split()
c2 = input().split()
for i in range(2):
  c1[i] = int(c1[i])
  c2[i] = int(c2[i])
t = int(input())
ans = 'NO'
j = 0
if c1[1] < c2[1]:
  ans = 'NO'
elif c1[1] == c2[1]:
  if c1[0] == c2[0]:
    ans = 'YES'
  else:
    ans = 'NO'
else:
  while t > j:
    if c1[0] < c2[0]:
      c1[0] += c1[1]
      c2[0] += c2[1]
      j += 1
    elif c1[0] > c2[0]:
      c1[0] -= c1[1]
      c2[0] -= c2[1]
      j += 1
    else:
      j += t
  if c1[0] == c2[0]:
    ans = 'YES'
  else:
    ans = 'NO'
print(ans)

Submission status: Time Limit Exceeded

Solution code:
a,v = map(int, input().split())
b,w = map(int, input().split())
T = int(input())
if v == w:
  print("NO")
  exit()

for i in range(0,T+1):
  if a == b:
    print("YES")
    exit()
  else:
    if a < b:
      a = a+v
      b = b+w
    else:
      a = a-v
      b = b-w
    
print("NO")

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
def main() :
     A,V = map(int,input().split())
     B,W = map(int,input().split())
     T = int(input())
     flag = True
     for i in range(T):
          if A >= B:
               flag = False
          A += V
          B += W
     if flag == True:
          print("NO")
     else:
          print("YES")
if __name__ == '__main__':
     main()

Submission status: Time Limit Exceeded

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
while T > 0:
  if A > B:
    A -= V
    B -= W
  else:
    A += V
    B += W
  if A == B:
    print("YES")
    exit()
  T -= 1
print("NO")

Submission status: Time Limit Exceeded

Solution code:
A,X=map(int,input().split())
B,Y=map(int,input().split())
T=int(input())
c=[]
lib=[]

for i in range(1,T+1):
  a=A+X*i
  b=B+Y*i 
  if A>B:
    while a>=b:
      if a==b:
        c.append(a)
        break
      if a<b:
        break
  else :
    while b>=a:
      if a==b:
        c.append(a)
        break
      if b<a:
        break
  
if len(c)==1:
  print('Yes')
else:
  print('No')

Submission status: Time Limit Exceeded

Solution code:
a = input().split()
b = input().split()

n = int(input())

c = float(a[0])
d = float(b[0])

for i in range(n):
    c = c + int(a[1])
    d = d + int(b[1])

if c <= d:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

if((b-a) > 0):
  for i in range(t):
    a += v
    b += w
  if(a >= b):
    print("YES")
  else:
    print("NO")
    
elif((b-a) < 0):
  for i in range(t):
    a -= v
    b -= w
  if(a <= b):
    print("YES")
  else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

while t>0:
    if a==b:
        break
    if a>b:
        a-=v
        b-=w
    elif a<b:
        a+=v
        b+=w
    t-=1
if a==b:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
A, V = [int(n) for n in input().split()]
B, W = [int(n) for n in input().split()]
T = int(input())

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


va = [A + V * t for t in range(1, T+1)]
va.extend([A - V * t for t in range(1, T+1)])
vb = [B + W * t for t in range(1, T+1)]
vb.extend([B - W * t for t in range(1, T+1)])

for a in va:
    for b in vb:
        if a == b:
            print('YES')
            exit()
print('NO')

Submission status: Time Limit Exceeded

Solution code:
a_v = list(map(int, input().split()))
b_w= list(map(int, input().split()))

t = int(input())

a = a_v[0]
b = b_w[0]
for _ in range(t):
    a += a_v[1]
    b += b_w[1]
if a >= b:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
A, W = map(int,input().split())
B, V = map(int,input().split())
T = int(input())
flag = "NO"
mid = T//2
i = 1
while True:
    i += 1
    a = A + W*mid
    b = B + V*mid
 
    if a == b:
        flag = "YES"
        break
    elif a > b and a + W < b + V:
        break
    elif a < b and a - W > b - V:
        break
    elif T//(2**i) == 0:
        if a > b:
            mid = mid - 1
            if mid < 1:
                mid = 1
        elif a < b:
            mid = mid + 1
            if mid > T:
                mid = T
    elif a > b:
        mid = mid - T//(2**i)
    elif a < b:
        mid = mid + T//(2**i)

print(flag)

Submission status: Time Limit Exceeded

Solution code:
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

Submission status: Time Limit Exceeded

Solution code:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if A == B:
  print("YES")
  exit()

if W >= V:
  print("NO")
  exit()
  
if A > B:
  V *= -1
  W *= -1
    
  for t in range(T):
    A += V
    B += W
    if A <= B:
      print("YES")
      exit()
  
else:
  for t in range(T):
    A += V
    B += W
    if A >= B:
      print("YES")
      exit()
      
print("NO")

Submission status: Time Limit Exceeded

Solution code:
in_a = [int(x) for x in input().split(' ')]
in_b = [int(x) for x in input().split(' ')]
t = int(input())

result = False

p_a = in_a[0]
p_b = in_b[0]
m_a = in_a[1]
m_b = in_b[1]

def to_right(p_a,p_b,m_a,m_b,t):
  for i in range(t):
    if m_a <= m_b:
      return False
    p_a += m_a
    p_b += m_b
    if p_a >= p_b:
      return True
  return False
      

def to_left(p_a,p_b,m_a,m_b,t):
  for i in range(t):
    if m_a <= m_b:
      return False
    p_a -= m_a
    p_b -= m_b
    if p_a <= p_b:
      return True
  return False

if p_a < p_b:
  result = to_right(p_a,p_b,m_a,m_b,t)
else:
  result = to_left(p_a,p_b,m_a,m_b,t)

if result:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

from decimal import Decimal
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if a == b:
    print("YES")
elif v <= w:
    print("NO")
elif a < b and w*t + b > v*t + a:
    print("NO")
elif a < b and -(w*t) + b < -(v*t) + a:
    print("NO")
else:
    now_a = a
    now_b = b
    for i in range(1, t+1):
        if now_a < now_b:
            now_a += v
            now_b += w
        else:
            now_a -= v
            now_b -= w
        if now_a == now_b:
            print("YES")
            exit()
        else:
            pass
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a = input().split()
b = input().split()

n = int(input())

c = int(a[0])
d = int(b[0])

for i in range(n):
    c = c + int(a[1])
    d = d + int(b[1])

if c <= d:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
input = stdin.readline
 
A,V = input().rstrip().split()
B,W = input().rstrip().split()
T = int(input().rstrip())
A,V,B,W = int(A),int(V),int(B),int(W)
s=0
if V<=W:
  print('NO')
  s=1
else:
  for t in range(T):
    if B<A:
      A-=V
      B-=W
      if B>=A:
        print('YES')
        s=1
        break
    else:
      A+=V
      B+=W
      if B<=A:
        print('YES')
        s=1
        break
if s!=1:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
#数値型を分割して取り出し
A, V = map(int, input().split())
B, W = map(int, input().split())
#数値型の取り出し
T = int(input())
AA = A
BB = B
ans = "NO"
for i in range(1,T+1):
  if BB >= AA:
    AA = AA + V
    BB = BB + W
  else:
    AA = AA - V
    BB = BB - W
  if AA == BB:
    ans = "YES"
    break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = input()

a = int(A) #+ (int(V) * int(T))
b = int(B) #+ (int(W) * int(T))

count = int(T)
while count > 0:
    a += (int(V) * int(T))
    b += (int(W) * int(T))
    count -= 1

if a >= b:
    print("YES")

else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
check=0
for i in range(T):
    if B>A:
        B=B+W
        A=A+V
    elif B<A:
        B=B-W
        A=A-V
    if A==B:
        check=1
        break
if check==1:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
A,V = [eval(x) for x in input().split(" ")]
B,W = [eval(y) for y in input().split(" ")]
t = int(input())
flag = 0
while t>0:
	if A == B:
		flag = 1
		print("YES")
		break
	A = A+V
	B = B+W
if flag == 0:
	print("NO")

Submission status: Time Limit Exceeded

Solution code:
def onigokko():
    A,V = map(int, input().split())
    B,W = map(int, input().split())
    T = int(input())
    
    if B < A:
        swap = A
        A = B
        B = swap
    
    for i in range(T):
        # Aから一番遠い所へ移動
        B += W

        # Aを動かす
        # 一番遠い所へ移動
        A += V

        # もし、A>=Bなら鬼の勝ち
        if A >= B:
            print('YES')
            return
    print('NO')

onigokko()

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

a, v = map(int,input().split())
b, w = map(int,input().split())
t = int(input())
for i in range(t):
    a = a + v 
    b = b + w 
if a >= b :
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a = input().split()
b = input().split()

n = int(input())

c = int(a[0])
d = int(b[0])

for i in range(n):
    c = c + int(a[1])
    d = d + int(b[1])

if c < d:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
oni = input().split()
oni_pos = int(oni[0])
oni_velo = int(oni[1])

nige = input().split()
nige_pos = int(nige[0])
nige_velo = int(nige[1])

time = int(input())
res=""
for i in range(time):
  oni_pos += oni_velo
  nige_pos += nige_velo
  if oni_pos >= nige_pos:
    res = "YES"
  else:
  	res = "NO"
print(res)

Submission status: Time Limit Exceeded

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
flg = 0

for _ in range(t):
    if a < b:
        if v <= w:
            break
        if a+v >= b+w:
            flg = 1
            break
        a = a+v
        b= b+w
    else:
        if v <= w:
            break
        if a-v <= b-w:
            flg = 1
            break
        a = a-v
        b=b-w
        
if flg == 0:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
a,v = input().split(' ')
b,w = input().split(' ')
T = int(input())
A = int(a)
V = int(v)
B = int(b)
W = int(w)

tagged = 0

if(W>V and abs(A-B) > abs(W-V)):
	print("NO")
else:
	for t in range(T+1):
		if(abs(A-B)==abs(V-W)*t):
			print("YES")
			tagged = 1
			break
	if(tagged == 0):        
		print("NO")

Submission status: Time Limit Exceeded

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

ok = False
for i in range(T+1):
    if A + (V*T) >= B + (W*T):
        ok = True

if ok:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

deltax = abs(A-B)
deltaV = V - W
if deltaV * T < deltax:
    flag = 0
else:
    t = 0
    beforedist = A - B
    while A != B and t < T:
        if A < B:
            A += V
            B += W
        if A > B:
            A -= V
            B -= W
        t += 1
        nowdist = A - B
        if nowdist == -beforedist:
            break
        beforedist = nowdist
    if A == B:
        flag = 1
    else:
        flag = 0

if flag == 0:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
T = int(input())

A =a[0]
V =a[1]
B= b[0]
W= b[1]
n = 0
while n in range(T):
    if A < B:
        A = A +V
        B = B + W
    elif A > B:
        A = A-V
        B = B-W
    elif A == B:
        break

if A == B:
    print("YES")
elif A != B:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
flg = 0

for _ in range(t):
    if a < b:
        if a+v >= b+w:
            flg = 1
        a = a+v
        b= b+w
    else:
        if a-v <= b-w:
            flg = 1
        a = a-v
        b=b-w
        
if flg == 0:
    print("NO")
else:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if v<=w:
    print("NO")
    exit()
if a<b:
    for i in range(t):
        a+=v
        b+=w
        if a>=b:
            print("YES")
            exit()
    print("NO")
    exit()
elif a>b:
    for i in range(t):
        a-=v
        b-=w
        if a<=b:
            print("YES")
            exit()
    print("NO")
    exit()
else:
    print("YES")
    exit()

Submission status: Time Limit Exceeded

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

sa = abs(a - b)
sas = abs(v - w)
if w >= v:
    print("NO")
    exit(0)

for i in range(t):
    sa -= sas
if sa <= 0:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
A_low =A
A_high =A
B_low = B
B_high=B
for i in range(T):
    A_low=A_low-V
    A_high=A_high+V
    B_low=B_low-W
    B_high=B_high+W
    if((B_low>=A_low) and (B_high<=A_high)):
    
        print("YES")
        exit()
    
print("NO")

Submission status: Time Limit Exceeded

Solution code:
a, v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())

def run(x,y):
    global a
    global b
    kyori1 = y-w
    kyori2 = y+w
    if abs(x-kyori1) > abs(x-kyori2):
        y -= w
    else:
        y += w
    
    kyo1 = x - v
    kyo2 = x + v
    if abs(y-kyo1) > abs(y-kyo2):
        x += v
    else:
        x -= v

    a = x
    b = y    

for i in range(t):
    run(a,b)
    if a == b:
        print('YES')
        exit()

print('NO')

Submission status: Time Limit Exceeded

Solution code:
a = input().split()
b = input().split()
n = int(input())

c = int(a[0])
d = int(b[0])
for i in range(n):
    c += int(a[1])
    d += int(b[1])

if c > d:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
T = int(input())

A =a[0]
V =a[1]
B= b[0]
W= b[1]

for n in range(T):
    if A < B:
        A = A +V
        B = B + W
    elif A > B:
        A = A-V
        B = B-W
    elif A == B:
        A = A+0
        B = B+0

if A == B:
    print("YES")
elif A != B:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a = input().split(" ")
b = input().split(" ")
c = int(input())
l = int(a[0])
r = int(a[1])
k = int(b[0])
s = int(b[1])
i = 0
while i < c :
    l = l + r
    k = k + s
    i = i + 1
if l > k :
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
import sys
a, v = list(map(lambda x: int(x), input().split(" ")))
b, w = list(map(lambda x: int(x), input().split(" ")))
t = int(input())

direction = 1 if b > a else - 1
if a == b:
  print('YES')
  sys.exit()

for i in range(0,t):
  a = a + direction * v
  b = b + direction * w
  if direction == 1 and a >= b:
    print('YES')
    sys.exit()
  if direction == -1 and a <= b:
    print('YES')
    sys.exit()

print('NO')

Submission status: Time Limit Exceeded

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
for i in range(t):
    a+=v
    b+=w
    if a>=b:
        flag=1
    else:
        flag=0
if flag==1:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
for i in range(t+1):
  if a<b:
    a+=v
    b+=w
    if a==b:
      print("YES")
      break
  else:
    a-=v
    b-=w
    if a==b:
      print("YES")
      break
else:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
A,V=map(int,input().split())
B,W=map(int,input().split())
K=int(input())
Apos=A
Bpos=B
count=0
rev=False
if B>A:
    pass
else:
    rev=True

if rev==False:

    while K>count:
        
        Apos=Apos+V
        Bpos=Bpos+W
        if Apos>=Bpos:
            print("YES")
            exit()
        count+=1
        

else:
    while K>count:
        
        Apos=Apos-V
        Bpos=Bpos-W
        if Apos<=Bpos:
            print("YES")
            exit()
        count+=1

print("NO")

Submission status: Time Limit Exceeded

Solution code:
a, v = map(int,input().split())
b, w = map(int,input().split())
t = int(input())
for i in range(t):
    a = a + v
    b = b + w
if a >= b :
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

a, v = map(int, readline().split())
b, w = map(int, readline().split())
t = int(readline())

d = abs(b - a)
flg = 0

for i in range(t):
    d = d - v + w
    if d <= 0:
        flg = 1

if flg == 1:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a=input().split(' ')
b=input().split(' ')
c=int(input())
i=0
d=int(a[0])
e=int(a[1])
f=int(b[0])
g=int(b[1])
while i<c:
    d=d+e
    f=f+g
    i=i+1
if f>d:
    print('NO')
else:
    print('YES')

Submission status: Time Limit Exceeded

Solution code:
A,V= map(int, input().split())
B,W= map(int, input().split())
T=int(input())
ans=0
for i in range(T):
    if A<B:
        A=A+V
        B=B+W
    else:
        A=A-V
        B=B-W
    if A==B:
        ans=1
        break

print("YES" if ans==1 else "NO")

Submission status: Time Limit Exceeded

Solution code:
if __name__ == '__main__':
    a, v = map(int, input().split())
    b, w = map(int, input().split())
    t = int(input())

    if w>= v:
        print("NO")
    else:
        flag = False
        if a == b:
            flag = True

        for i in range(t):
            if b>a:
                a+=v
                b+=w
            else:
                a-=v
                b-=w
            if a==b:
                flag=True
        if flag:
            print("YES")
        else:
            print("NO")

Submission status: Time Limit Exceeded

Solution code:
A,V=map(int, input().split())
B,W=map(int, input().split())
T = int(input())
k = abs(A-B)
d = V-W
if d <= 0:
  print("NO")
else:
  for i in range(T):
    k -= d
    if k <= 0:
      print("YES")
      break
  else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
# tokiomarine2020_b.py
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if V<=W:
    print('NO')
    exit()

if A<B:
    for i in range(T):
        A += V
        B += W
        if A>=B:
            print('YES')
            exit()
else:
    for i in range(T):
        A -= V
        B -= W
        if A<=B:
            print('YES')
            exit()
print("NO")

Submission status: Time Limit Exceeded

Solution code:
A , V = map(int, input().split())
B , W = map(int, input().split())
T = int(input())
flag = 0
for i in range(T):
    B += W
    A += V
    if B <= A:
        flag = 1
if flag == 1:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

dist = abs(b - a)
mys = v - w

for i in range(t):
  dist -= mys
  if dist <= 0:
    print("YES")
    exit()
print("NO")

Submission status: Time Limit Exceeded

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t=int(input())
for i in range(t):
    a+=v
    b+=w
if (a>=b):
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a, v = list(map(int, input().split()))
b, w = list(map(int, input().split()))
t = int(input())
for i in range(t):
  a += v
  b += w
if a >= b:
  print('YES')
else:
  print('NO')

Submission status: Time Limit Exceeded

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
for i in range(t):
    a += v
    b += w

if a >= b:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
#N = int(input())
A,V=map(int, input().split())
B,W=map(int, input().split())
T=int(input())

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

SA=abs(A-B)
i=0
while i<T:
    SA=SA-(V-W)
    i+=1
    
if SA<=0:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
ans = "NO"
for _ in range(t):
    if a>=b:
        ans = "YES"
    a+=v
    b+=w
print(ans)

Submission status: Accepted

Solution code:
A,V = map(int,input().split())
B,W= map(int,input().split())
T = int(input())
dist = abs(A-B)
vec = V-W
print('YES' if vec*T >= dist else 'NO')

Submission status: Accepted

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

if a < b:
    if a+v*t >= b + w*t:
        print('YES')
    else:
        print('NO')
else:
    if a-v*t <= b-w*t:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
def main():
    a,v=map(int,input().split())
    b,w=map(int,input().split())
    t=int(input())
    distance=abs(a-b)
    ve=v-w
    if ve<=0:
        print("NO")
        return
    if distance<=ve*t:
        print("YES")
        return
    else:
        print ( "NO" )
        return
main()

Submission status: Accepted

Solution code:
def main():
    a,v=map(int,input().split())
    b,w=map(int,input().split())
    t=int(input())
    distance=abs(a-b) if a>=b else abs(b-a)
    ve=v-w
    if ve<=0:
        print("NO")
        return
    if distance<=ve*t:
        print("YES")
        return
    else:
        print ( "NO" )
        return



main()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    a,v = LI()
    b,w = LI()
    t = I()
    if v <= w:
        print("NO")
        return
    s = abs(b-a)
    k = v-w
    if s <= t*k:
        print("YES")
    else:
        print("NO")
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import math
import collections
import itertools
import copy

def YesNo(Bool):
    if(Bool):
        print("YES")
    else:
        print("NO")
    return

def resolve():

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

    if(A<B and V<=W):
        print("NO")
        return

    if(A>B and V<=W):
        print("NO")
        return

    if(A<B):
        if(A+V*T >= B+W*T):
            print("YES")
        else:
            print("NO")
    else:
        if(A-V*T <= B-W*T):
            print("YES")
        else:
            print("NO")

resolve()