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-b <= t*(v-w):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
def tag(a,b,v,w,t):
    res = (b+(v*t))-(a+(w*t))
    if res>=0:
        return "YES"
    return "NO"

if __name__ == "__main__":
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())
    print(tag(a,b,v,w,t))

Submission status: Wrong Answer

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
pos = abs(A-B)
mob = abs(V-W)
if pos - mob*T <= 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def tag(a,b,v,w,t):
    if w>=v:
        return "NO"
    res = (b+(v*t))-(a+(w*t))
    if res>=0:
        return "YES"
    return "NO"

if __name__ == "__main__":
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())
    print(tag(a,b,v,w,t))

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
A, V = map(Decimal, input().split())
B, W = map(Decimal, input().split())
T = Decimal(input())
dv = Decimal(V - W)
dist = abs(Decimal(B - A))
if dv > 0:
    if Decimal(dv - dist/T) >= 0:
        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 W >= V:
  print('NO')
elif B - A == 0:
  print('NO')
else:
  if (B - A) / (W - V) <= T:
    print('YES')
  else:
    print('NO')

Submission status: Wrong Answer

Solution code:
inputA = input()
inputB = input()
secIn = input()
sec = int(secIn)
splitA = inputA.split()
splitB = inputB.split()
curA = int(splitA[0])
a = int(splitA[1])
curB = int(splitB[0])
b = int(splitB[1])

d = curA - curB
dis = d if d > 0 else -d

result = "NO"
v = a - b
if v <= 0:
    result = "NO"
elif dis % v != 0:
    result = "NO"
elif dis / v < sec:
    result = "YES"
else:
    result = "NO"

print(result)

Submission status: Wrong Answer

Solution code:
A, V = map(int,input().split())
B, W = map(int,input().split())
T    = int(input())
for i in range(1,T+1):
  j = A + (i * V)
  k = B + (i * W)
  if j  >= k:
    print("YES")
    break
else:
  print("NO")

Submission status: Wrong Answer

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

distance = abs(a-b)
speed = v - w

if (speed <= 0) or (t * speed < distance):
  print('NO')
  exit()

last_distance = distance % speed
if ((last_distance % 2) == (speed % 2)) or last_distance == 0:
  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 A > B and V > W:
    print('NO')
     
elif B > A and W > V:
    print('NO')


else:
    print('YES')

Submission status: Wrong Answer

Solution code:
def main():
  xy = [map(int, input().split()) for _ in range(2)]
  x,y = [list(i) for i in zip(*xy)]
  a = int(input())
  
  for j in range(a):
    x[0] = x[0] + y[0]
    x[1] = x[1] + y[1]
    k = x[1]-x[0]
    
    print(x[0])
    print(x[1])
    
    if k <= a*y[0]:
      print("YES")
      break
      
    elif j == a-1:
      print("NO")
      break
      
      
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    A, V = map(int,input().split())
    B, W = map(int,input().split())
    T = int(input())
    if A < B and A+V*T >= B+W*T:
        return('YES')
    elif A > B and A+V*T >= B+W*T:
    	return('YES')
    else:
        return('YES')
print(main())

Submission status: Wrong Answer

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

m=0
for i in range(0, t):
	if a>b:
		a=a-v
		b=b-w
	elif b>a:
		a=a+v
		b=b+w
	elif a==b:
		print('YES')
		m=1
if m==0:
	print('NO')

Submission status: Wrong Answer

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

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

if A > B:
    print('NO')
    exit()

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

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

Submission status: Wrong Answer

Solution code:
import math

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

if A>B:
    C=A
    A=B
    B=C

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

    if V<=W:
        print("NO")
    else:
        x=(1-(A-B)/(V-W))
        xint=math.floor(1-(A-B)/(V-W))
        A=A+(xint-1)*V
        B=B+(xint-1)*W

        if (xint-1)>T:
            print("NO")
        else:
            
            for i in range (1,3):
                if A<B:
                    A=A+V
                    B=B+W
                else:
                    A=A-V
                    B=B-W
                if xint+i>T:
                    ans=0
                    break
                if A==B:
                    ans=1
                    break
                
            print("YES" if ans==1 else "NO")

Submission status: Wrong Answer

Solution code:
n = "NO"
y = "YES"

A, V = map(int, input().split()) #Aは初期座標 Vは1秒あたりの移動距離#
B, W = map(int, input().split()) #Aは初期座標 Wは1秒あたりの移動距離#
T = int(input()) #移動許可秒数#

##################################################
# 答えはT秒後に鬼が逃げ役と同じ座標or追い越せばYES#
# 計算はTLE対策として掛け算を使用　　　　　　　　　#
#V,W * T でT秒間の移動距離を算出 　　　　　　　　　#
# ANS = A,B + V,W * T　　　　　　　　　　　　　　　#   
##################################################

X = V * T
Y = W * T

A += X
B += Y

if B >= A:
  print(y)
else:
  print(n)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

if __name__ == '__main__':
	A, V = list(map(lambda x:int(x), sys.stdin.readline().rstrip().split(' ')))
	B, W = list(map(lambda x:int(x), sys.stdin.readline().rstrip().split(' ')))
	T = int(sys.stdin.readline())

	dist = B - A
	d_dist = V - W
	if np.sign(dist) != np.sign(d_dist):
		print('NO')
		exit()
	
	# print(dist, d_dist, T)
	if d_dist != 0 and dist % d_dist == 0 and d_dist * T >= dist:
		print('YES')
	else:
		print('NO')

Submission status: Wrong Answer

Solution code:
inputA = input()
inputB = input()
secIn = input()
sec = int(secIn)
splitA = inputA.split()
splitB = inputB.split()
curA = int(splitA[0])
a = int(splitA[1])
curB = int(splitB[0])
b = int(splitB[1])

d = curA - curB
dis = d if d > 0 else -d

result = "NO"
v = a - b
if v <= 0:
    result = "NO"
elif dis % v != 0:
    result = "NO"
elif dis / v > sec:
    result = "NO"
else:
    result = "YES"

print(result)

Submission status: Wrong Answer

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

import math

def check():
  deltaD=B-A
  deltaV=V-W
  if deltaD<0:
    return 'NO'  
  if deltaV==0:
    return 'NO'
  if deltaD % abs(deltaV)==0:
    if T*deltaV>=deltaD:
      return 'YES'
    else:
      return 'NO'    
  return 'NO'
print(check())

Submission status: Wrong Answer

Solution code:
def main():
    A, V = map(int,input().split())
    B, W = map(int,input().split())
    T = int(input())
    if A < B and A+V*T >= B+W*T:
        return('YES')
    elif A > B and A+V*T <= B+W*T:
    	return('YES')
    else:
        return('YES')
print(main())

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 A > B and V > W:
    print('NO')
     
elif B > A and W > V:
    print('NO')

elif A > B and W > V and (A-B) % (W-V) == 0:
    if abs((A-B) / (W-V)) <= T:
        print('YES')
    else:
        print('YES')
    
elif B > A and V > W and (B-A) % (V-W) == 0:
   if abs((B-A) / (V-W)) <= T:
        print('YES')
   else:
        print('YES')

else:
    print('YES')

Submission status: Wrong Answer

Solution code:
a, a_v = map(int, input().split())
b, b_v = map(int, input().split())
t = int(input())

a_st = 0
a_ed = 0
if a < a_v*t:
  a_st = a
  a_ed = a+a_v*t
else:
  a_st = a+a_v*t
  a_ed = a

b_st = 0
b_ed = 0
if b < b_v*t:
  b_st = b
  b_ed = b+b_v*t
else:
  b_st = b+b_v*t
  b_ed = b

if b_st < a_ed or a_st < b_ed:
  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 < B:
  if (V*T + W*T) >= B - A:
      print("YES")
  else:
      print("NO")
elif A > B:
  if (V*T + W*T) >= A - B:
      print("YES")
  else:
      print("NO")

Submission status: Wrong Answer

Solution code:
a,v = (int(x) for x in input().split())
b, w = (int(x) for x in input().split())
t = input()
 
if w >= v:
  print("NO")
elif a == b:
  print("YES")
elif t == 0:
  print("NO")
else:
  print("NO")

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
# import copy


def xnxn(n=0, flag="v"):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            if flag == "l":
                return temp
            else:
                return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


a, v = xnxn()
b, w = xnxn()
t = xnxn()


# for i in range(t):
#     if b - a > 0:
#         b = min(b + w, 10 ** 9)
#         a = min(a + v, 10 ** 9)
#         if b == a:
#             print("YES")
#             sys.exit()
#     elif b - a < 0:
#         b = max(b - w, 10 ** 9)
#         a = max(a - v, 10 ** 9)
#         if b == a:
#             print("YES")
#             sys.exit()

# print("NO")

if b - a > 0:
    b_f = min(b+t*w, 10 ** 9)
    a_f = min(a+t*v, 10 ** 9)
    if b_f > a_f:
        print("NO")
    else:
        print("YES")


else:
    b_f = max(b-t*w, -10 ** 9)
    a_f = max(a-t*v, -10 ** 9)
    if b_f < a_f:
        print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

Solution code:
def main():
    A, V = map(int,input().split())
    B, W = map(int,input().split())
    T = int(input())
    if A < B and A+V*T >= B+W*T:
        return('YES')
    if A > B and A+V*T >= B+W*T:
    	return('YES')
    else:
        return('YES')
print(main())

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 A > B and V > W:
    print('NO')
     
elif B > A and W > V:
    print('NO')

elif A > B and W > V and (A-B) % (W-V) == 0:
    if abs((A-B) / (W-V)) <= T:
        print('YES')
    else:
        print('NO')
    
elif B > A and V > W and (B-A) % (V-W) == 0:
   if abs((B-A) / (V-W)) <= T:
        print('YES')
   else:
        print('NO')

else:
    print('YES')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inputA = input()
inputB = input()
secIn = input()
sec = int(secIn)
splitA = inputA.split()
splitB = inputB.split()
curA = int(splitA[0])
a = int(splitA[1])
curB = int(splitB[0])
b = int(splitB[1])

dis = curA - curB if curA > curB else curB - curA

result = "NO"
v = a - b
if v <= 0:
    result = "NO"
elif dis % v != 0:
    result = "NO"
elif dis / v > sec:
    result = "NO"
else:
    result = "YES"

print(result)

Submission status: Wrong Answer

Solution code:
import math

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

if A>B:
    C=A
    A=B
    B=C

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

    if V<=W:
        print("NO")
    else:
        x=(1-(A-B)/(V-W))
        xint=math.floor(1-(A-B)/(V-W))
        A=A+(xint-1)*V
        B=B+(xint-1)*W

        if (xint-1)>T:
            print("NO")
        else:
            
            for i in range (3):
                if A<B:
                    A=A+V
                    B=B+W
                else:
                    A=A-V
                    B=B-W
                if xint+i>T:
                    ans=0
                    break
                if A==B:
                    ans=1
                    break
                
            print("YES" if ans==1 else "NO")

Submission status: Wrong Answer

Solution code:
import sys
A,V = map(int, input().split())
B,W = map(int, input().split())
T  = int(input())
if A > B + W * T:
    print("NO")
    sys.exit()
if A + V * T < B:
    print("NO")
    sys.exit()
for i in range(T):
    A += V 
    B += W 
    if A == B:
        print("YES")
        sys.exit()
        
print("NO")

Submission status: Wrong Answer

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

if W >= V:
  print('NO')
else:
  if (B - A) / (W - V) <= 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())
r = 'NO'
if (w - v) * t + b + a >= 0:
    r = 'YES'
print(r)

Submission status: Wrong Answer

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

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

if A > B:
    print('NO')
    exit()

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

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

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = int(input())
 
aa = a[0]+a[1]*c
bb = b[0]+b[1]*c
d = aa - bb
e = a[1]-b[1]

if e == 0 or e < 0:
  print("NO")
else:
  if aa > bb:
    if d % e == 0:
      print("YES")
  elif aa == bb:
    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())

d0 = abs(A - B)
dx = V - W

for i in range(1, T+1):
  if T*dx < d0:
    print("NO")
    break
  if i*dx == d0:
  	print("YES")
  	break
    
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 A < B and A+V*T >= B+W*T:
        return('YES')
    if A > B and A+V*T <= B+W*T:
    	return('YES')
    else:
        return('YES')
print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

if A == B and V == W:
    print("YES")
else:
    if A != B and V == W:
        print("NO")
    else:
        x = math.ceil(abs((A - B)/(W - V)))
        if A + V * T >= B + W * T:

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

Submission status: Wrong Answer

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

d=abs(a-b)

f=0

for i in range(0,t):
  for x in range(0,1):
    z=(v+w)*x+(v-w)*(i-x)
    if z == d:
      f=1
    z=(v+w)*x+(w-v)*(i-x)
    if z == d:
      f=1
      
if f == 1:
	print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
n = "NO"
y = "YES"

A, V = map(int, input().split()) #Aは初期座標 Vは1秒あたりの移動距離#
B, W = map(int, input().split()) #Aは初期座標 Wは1秒あたりの移動距離#
T = int(input()) #移動許可秒数#

##################################################
# 答えはT秒後に鬼が逃げ役と同じ座標or追い越せばYES#
# 計算はTLE対策として掛け算を使用　　　　　　　　　#
#V,W * T でT秒間の移動距離を算出 　　　　　　　　　#
# ANS = A,B + V,W * T　　　　　　　　　　　　　　　#   
##################################################

X = V * T
Y = W * T

A += X
B += Y

if A < B:
  print(n)
elif B >= A:
  print(y)

Submission status: Wrong Answer

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

A = int(A)
B = int(B)
V = int(V)
W = int(W)
T = int(T)

if A >= 0 and B >= 0:
    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")


elif A > 0 and B < 0:
    if (A - V * T) < (B - W * T):
        print("YES")
    else:
        print("No")

elif A < 0 and B > 0:
    if (A + V * T) > (B + W * T):
        print("YES")
    else:
        print("NO")

else:
    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: Wrong Answer

Solution code:
from decimal import Decimal
A, V = map(Decimal, input().split())
B, W = map(Decimal, input().split())
T = Decimal(input())
dv = Decimal(V - W)
dist = abs(Decimal(B - A))
if dv > 0:
    if Decimal(dv * T- dist) >= 0:
        print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
inputA = input()
inputB = input()
secIn = input()
sec = int(secIn)
splitA = inputA.split()
splitB = inputB.split()
curA = int(splitA[0])
a = int(splitA[1])
curB = int(splitB[0])
b = int(splitB[1])

dis = curA - curB if curA > curB else curB > curA

result = "NO"
v = a - b
if v <= 0:
    result = "NO"
elif dis % v != 0:
    result = "NO"
elif dis / v > sec:
    result = "NO"
else:
    result = "YES"

print(result)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys

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

if v == w or a == b:
    print("NO")
    sys.exit()


def onigokko(a, v, b, w):
    if b > a:
        time = (b-a)/(v-w)
    else:
        time = (b-a)/(w-v)

    if time < 0:
        return False
    if time > t:
        return False
    if time.is_integer():
        return True

result = False
try:
    result = onigokko(a, v, b, w)
except:
    result = False

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

Submission status: Wrong Answer

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

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())

    for i in range(t):
        a = a+v
        b = b+w
        if a == b:
            return print('YES')
    return print('NO')


if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def tag(a,b,v,w,t):
    if w>=v:
        return "NO"
    res = (a+(v*t))-(b+(w*t))
    if res>=0:
        return "YES"
    return "NO"

if __name__ == "__main__":
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())
    print(tag(a,b,v,w,t))

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 A > B and V > W:
    print('NO')
     
elif B > A and W > V:
    print('NO')

elif A > B and W > V and (A-B) % (W-V) == 0:
    if abs((A-B) / (W-V)) <= T:
        print('YES')
    else:
        print('NO')
    
elif B > A and V > W and (B-A) % (V-W) == 0:
   if abs((B-A) / (V-W)) <= T:
        print('YES')
   else:
        print('NO')

else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import math

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

if A>B:
    C=A
    A=B
    B=C

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

    if V<=W:
        print("NO")
    else:
        x=(1-(A-B)/(V-W))
        xint=math.floor(1-(A-B)/(V-W))
        A=A+(xint-1)*V
        B=B+(xint-1)*W

        if (xint-1)>T:
            print("NO")
        else:
            
            for i in range (2):
                if A<B:
                    A=A+V
                    B=B+W
                else:
                    A=A-V
                    B=B-W
                if xint+i>T:
                    ans=0
                    break
                if A==B:
                    ans=1
                    break
                
            print("YES" if ans==1 else "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 and a < b and (b+w*t <= a+v*t):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 13 22:44:04 2020

@author: sd18016
"""
import sys
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

kyori = abs(A-B)
miji = abs(V-W)
if miji == 0:
    print("NO")
    sys.exit()
else:
    if kyori % miji != 0:
        print("NO")
    else:
        a = kyori // miji
        if 1<= a <=T:
            print("YES")
        else:
            print("NO")

Submission status: Wrong Answer

Solution code:
n = "NO"
y = "YES"

A, V = map(int, input().split()) #Aは初期座標 Vは1秒あたりの移動距離#
B, W = map(int, input().split()) #Aは初期座標 Wは1秒あたりの移動距離#
T = int(input()) #移動許可秒数#

##################################################
# 答えはT秒後に鬼が逃げ役と同じ座標or追い越せばYES#
# 計算はTLE対策として掛け算を使用　　　　　　　　　#
#V,W * T でT秒間の移動距離を算出 　　　　　　　　　#
# ANS = A,B + V,W * T　　　　　　　　　　　　　　　#   
##################################################

X = V * T
Y = W * T

A += X
B += Y

if A < B:
  print(y)
elif A >= B:
  print(n)

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):
    if B < A:
        print("No")
    else:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a = abs(a)
b = abs(b)

if a > b:
    b = b - (b - 1)
    a = a - (b - 1)
else:
    a = a - (a - 1)
    b = b - (a - 1)

# 鬼と逃げる人がぶつかる場所
meetingplace = int(lcm(a, b) + lcm(v, w))

requiredtime = int((meetingplace - v) / a) // v

if v > w:
    if t >= requiredtime:
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import math

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

if A>B:
    C=A
    A=B
    B=C

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

    if V<=W:
        print("NO")
    else:
        x=(1-(A-B)/(V-W))
        xint=math.floor(1-(A-B)/(V-W))
        A=A+(xint-1)*V
        B=B+(xint-1)*W

        if (xint-1)>T:
            print("NO")
        else:
            
            for i in range (3):
                if A<B:
                    A=A+V
                    B=B+W
                else:
                    A=A-V
                    B=B-W
                if xint+1+i>T:
                    ans=0
                    break
                if A==B:
                    ans=1
                    break
                
            print("YES" if ans==1 else "NO")

Submission status: Wrong Answer

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
d = abs(a-b)
if w >= v:
    print('NO')
else:
    if d%(v-w)==0:
        if d//(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())
flag = False

if a<b and v<w:
    print('No')
elif b<a and w<v:
    print('No')
else:
    for i in range(t):
        a += v
        b += w
        if a == b:
            print('YES')
            flag = True
            break
    if flag is False:
        print('No')

Submission status: Wrong Answer

Solution code:
import math

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

if A>B:
    C=A
    A=B
    B=C

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

    if V<=W:
        print("NO")
    else:
        x=(1-(A-B)/(V-W))
        xint=math.floor(1-(A-B)/(V-W))
        A=A+(xint-1)*V
        B=B+(xint-1)*W

        if (xint-1)>T:
            print("NO")
        else:
            
            for i in range (3):
                if A<B:
                    A=A+V
                    B=B+W
                else:
                    A=A-V
                    B=B-W
                if xint-1+i>T:
                    ans=0
                    break
                if A==B:
                    ans=1
                    break
                
            print("YES")
            #print("YES" if ans==1 else "NO")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys

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

if v == w or a == b:
    print("NO")
    sys.exit()

def onigokko(a, v, b, w):

    if b > a:
        time = (b-a)/(v-w)
    else:
        time = (b-a)/(w-v)

    if time < 0:
        return False
    if time.is_integer():
        return True
    if time > t:
        return False

result = False
try:
    result = onigokko(a, v, b, w)
except:
    result = False

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

Submission status: Wrong Answer

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])
if (((r * c) + l) >= ((s * c) + k)) or l < 0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
def oni(ax, av, bx, bv, t):
    x = bx - ax
    v = av - bv

    if (v <= 0):
        print('NO')
    elif (x/v > t):
        print('NO')
    elif (x%v == 0): 
        print('YES')
    else:
        print('NO')

ax, av = list(map(int, input().split()))
bx, bv = list(map(int, input().split()))
t = int(input())

oni(ax, av, bx, bv, t)

Submission status: Wrong Answer

Solution code:
def tag(a,b,v,w,t):
    if w>=v:
        return "NO"
    res = ((v*t)-a)-(b+(w*t)-a)
    if res==0:
        return "YES"
    return "NO"

if __name__ == "__main__":
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())
    print(tag(a,b,v,w,t))

Submission status: Wrong Answer

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

A = int(A)
B = int(B)
V = int(V)
W = int(W)
T = int(T)

if A > 0 and B > 0:
    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")


elif A > 0 and B < 0:
    if (A - V * T) < (B - W * T):
        print("YES")
    else:
        print("NO")

elif A < 0 and B > 0:
    if (A + V * T) > (B + W * T):
        print("YES")
    else:
        print("NO")
else:
    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: 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:
from decimal import Decimal
A, V = map(Decimal, input().split())
B, W = map(Decimal, input().split())
T = Decimal(input())
dv = Decimal(V - W)
dist = abs(Decimal(B - A))
if dv > 0:
    if Decimal(dv * T) >= dist:
        print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys
s = sys.stdin.readlines
A, V = [int(x) for x in input().split()]
B, W= [int(x) for x in input().split()]
T = int(input())

if A < B and V <= W or A > B and V >= W:
    print('NO')
    sys.exit()

if A == B and V == W:
    print('YES')
    sys.exit()

if A < B:
    k = (A + V * T) - (B + W * T)
    j = (B - A) % (V / W)
    if j == 0 and k >=  0  :
        print('YES')
    else:
        print('NO')
else:
    k = (B + W * T) - (A + V * T)
    j = (A - B) % (W / V)
    if j == 0 and k >=  0  :
        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')
else:
    if 1 <= ((b - a) / (v - w)) <= t:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
import sys

if __name__ == '__main__':
	A, V = list(map(lambda x:int(x), sys.stdin.readline().rstrip().split(' ')))
	B, W = list(map(lambda x:int(x), sys.stdin.readline().rstrip().split(' ')))
	T = int(sys.stdin.readline())

	dist = abs(B - A)
	d_dist = abs(V - W)
	
	# print(dist, d_dist, T)
	if d_dist != 0 and dist % d_dist == 0 and d_dist * T >= dist:
		print('YES')
	else:
		print('NO')