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:
import math

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

MAX = 10**9
MIN = -(10**9)
# MAX = 5
# MIN = -5

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

if abs(V - W) % 2 == 0:
    if abs(A - B) % 2 == 1:
        print("NO")
        exit()

if A >= B:
    time = abs((MIN - B) // V)
    position_A = A - V * time
    position_B = B - W * time
    # print("time: {}, position_A: {}, position_B: {}".format(time, position_A, position_B))
    distance = abs(position_A - position_B)
    while distance != 0:
        time += 1
        position_B = MIN + (W - abs(MIN - position_B))
        position_A = position_A - V
        if position_A < MIN:
            tmp = position_A % MIN
            position_A = MIN + tmp
        distance = abs(position_A - position_B)
        # print("time: {}, position_A: {}, position_B: {}".format(time, position_A, position_B))
        if (time > T):
            print("NO")
else:
    time = abs((MAX - B) // V)
    position_A = A + V * time
    position_B = B + W * time
    # print("time: {}, position_A: {}, position_B: {}".format(time, position_A, position_B))
    distance = abs(position_A - position_B)
    while distance != 0:
        time += 1
        position_B = MAX - (W - abs(MAX - position_B))
        position_A = position_A + V
        if position_A > MAX:
            tmp = position_A % MAX
            position_A = MAX - tmp
        distance = abs(position_A - position_B)
        # print("time: {}, position_A: {}, position_B: {}".format(time, position_A, position_B))
        if (time > T):
            print("NO")

print("YES")

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) != 0:
    print('NO')
elif abs(A - B) / abs(V - W) > T:
    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')
    else:
        return('YES')
print(main())

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 = Decimal(abs(B - A))
if dv > 0:
    if Decimal(dv * T) >= dist:
        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')

#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:
def main():
    a,v = list(map(int,input().split()))
    b,w = list(map(int,input().split()))
    t = int(input())

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


if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
a_now, a_speed = map(int, input().split(' '))
b_now, b_speed = map(int, input().split(' '))
t = int(input())

# print(a_now, a_speed, b_now, b_speed, t)

# speedの差分と現在の差分で割り切れればOK、割り切れなければダメ
caught = 'NO'
if(a_now < b_now and a_speed <= b_speed):
  #print("aのほうが遅いので一生捕まらない")
  caught = 'NO'
elif(a_now > b_now and a_speed >= b_speed):
  #print("aのほうが先に行ってるので一生捕まらない")
  caught = 'NO'
else:
  diff = abs(a_now - b_now)
  speed = abs(a_speed - b_speed)
  #print("現在の距離差は{0}. スピード差は{1}".format(diff, speed))
  if(diff == 0):
    caught = 'NO'
  elif(speed == 0):
    #print("speedが一緒なので終わらない")
    caught = 'NO'
  else:
      q = diff // speed
      mod = diff % speed
      #print("おいつくのは{0}秒後. 余りは{1}".format(q, mod))
      if(q <= t and mod == 0):
        caught = 'YES'
      else:
        caught = 'NO'
  
    
print(caught)

Submission status: Wrong Answer

Solution code:
def tag(a,b,v,w,t):
    if w>=v:
        return "NO"
    res = (a+(v*t)-1)-(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:
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+=1
B+=1

A += X
B += Y

if A < B:
  print(n)
else:
  print(y)

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):
  print("YES")
else:
  x = (B-A)/(V-W)
  if(abs(int(x)) <= T and int(x)==x):
    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
 
if aa > bb:
  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())
if a+t*v >= b+t*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')
    exit()

for i in range(t+1):
    at = v*i + a
    bt = w*i + b
    if at == bt:
        print('YES')
        exit()

print('NO')

Submission status: Wrong Answer

Solution code:
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())
C = int(input())

Adist = A1 + A2 * C
Bdist = B1 + B2 * C

if Bdist<=Adist:
  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 = min(b-t*w, -10 ** 9)
    a_f = min(a-t*v, -10 ** 9)
    if b_f < a_f:
        print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

Solution code:
import sys

A, V = [int(x) for x in input().strip().split(" ")]
B, W = [int(x) for x in input().strip().split(" ")]
T = int(input().strip())

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

distance = abs(A - B)
diff = abs(V - W)

t, distance = divmod(distance, diff)
T -= t
if 0 > T:
    print("NO")
    sys.exit(0)
print("YES")
sys.exit(0)

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 = Decimal(abs(B - A))
if dv > 0:
    if dv * T >= dist:
        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())

# MAX = 10**9
# MIN = -(10**9)
MAX = 5
MIN = -5

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

if abs(V - W) % 2 == 0:
    if abs(A - B) % 2 == 1:
        print("NO")
        exit()

if A >= B:
    time = abs((MIN - B) // V)
    position_A = A - V * time
    position_B = B - W * time
    # print("time: {}, position_A: {}, position_B: {}".format(time, position_A, position_B))
    distance = abs(position_A - position_B)
    while distance != 0:
        time += 1
        position_B = MIN + (W - abs(MIN - position_B))
        position_A = position_A - V
        if position_A < MIN:
            tmp = position_A % MIN
            position_A = MIN + tmp
        distance = abs(position_A - position_B)
        # print("time: {}, position_A: {}, position_B: {}".format(time, position_A, position_B))
        if (time > T):
            print("NO")
else:
    time = abs((MAX - B) // V)
    position_A = A + V * time
    position_B = B + W * time
    # print("time: {}, position_A: {}, position_B: {}".format(time, position_A, position_B))
    distance = abs(position_A - position_B)
    while distance != 0:
        time += 1
        position_B = MAX - (W - abs(MAX - position_B))
        position_A = position_A + V
        if position_A > MAX:
            tmp = position_A % MAX
            position_A = MAX - tmp
        distance = abs(position_A - position_B)
        # print("time: {}, position_A: {}, position_B: {}".format(time, position_A, position_B))
        if (time > T):
            print("NO")

print("YES")

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) != 0:
    print('NO')
elif abs(A - B) // abs(V - W) > T:
    print('NO')
else:
    print('YES')

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())
    
    if w > v:
        return print('NO')
    elif a+(t-1)*v == b+(t-1)*w:
        return print('YES')
    else:
        return 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())
x = b - a
y = v - w
n = (a + v * t) - (b + w)
if y <= 0:
    print("NO")
elif x % y == 0 and n >= 0:
    print("YES")
else:
    print("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())


def onigokko(a, v, b, w):
    if v == w or a == b:
        return False

    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:
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')
    else:
        for i in range(T):
            A += V
            B += W
            if A <= B:
                return('YES')
        return('NO')
print(main())

Submission status: Wrong Answer

Solution code:
a_now, a_speed = map(int, input().split(' '))
b_now, b_speed = map(int, input().split(' '))
t = int(input())

# print(a_now, a_speed, b_now, b_speed, t)

# speedの差分と現在の差分で割り切れればOK、割り切れなければダメ
caught = 'NO'
if(a_now < b_now and a_speed <= b_speed):
  #print("aのほうが遅いので一生捕まらない")
  caught = 'NO'
elif(a_now > b_now and a_speed >= b_speed):
  #print("aのほうが先に行ってるので一生捕まらない")
  caught = 'NO'
else:
  diff = abs(a_now - b_now)
  speed = abs(a_speed - b_speed)
  #print("現在の距離差は{0}. スピード差は{1}".format(diff, speed))
  if(diff == 0):
    caught = 'YES'
  elif(speed == 0):
    #print("speedが一緒なので終わらない")
    caught = 'NO'
  else:
      q = diff // speed
      mod = diff % speed
      #print("おいつくのは{0}秒後. 余りは{1}".format(q, mod))
      if(q < t and mod == 0):
        caught = 'YES'
      else:
        caught = 'NO'
  
    
print(caught)

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:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if v > w and a < b and (b-a)/(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())
def solve():
    d = b - a
    return (v - w) * t >= d
print('YES' if solve() 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==0:
  print('NO')
else:  
  if 0 <= (B - A) / (V - 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 = Decimal(abs(B - A))
if dv > 0 and dist%dv==0:
    if dv * T >= dist:
        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')
    exit()

tmp = abs(B - A)
k = B - W
if tmp <= k * T:
    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:
    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:
P = []
S = []
for i in range(2):
    pp, ss  = map(int, input().split())
    P.append(pp)
    S.append(ss)
 
A = P[0]
V = S[0]
B = P[1]
W = S[1]
T = int(input())
 
def run():
	if A < B:
		c = (B + V*T) - (A + W*T)
		if c <= 0 :
			return 'YES'
		else :
			return 'NO'
	elif A > B:
		c =  (B - V*T) - (A - W*T)
		if c >= 0 :
			return 'YES'
		else :
			return 'NO'
	else :
		return 'YES'
print(run())

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 = B - A
	d_dist = 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')

Submission status: Wrong Answer

Solution code:
oni = input().split()
kodomo = input().split()
limit_time = int(input())

oni_ichi = int(oni[0])
oni_move = int(oni[1])

kodomo_ichi = int(kodomo[0])
kodomo_move = int(kodomo[1])

move_dir_num = oni_ichi - kodomo_ichi

if move_dir_num >= 0:
  res = (kodomo_ichi - kodomo_move * limit_time) - (oni_ichi - oni_move * limit_time)
else:
  res = (kodomo_ichi + kodomo_move * limit_time) + (oni_ichi + oni_move * limit_time)
  
if res < 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>0 & abs(a-b) <= t*(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())

import math

def check():
  deltaD=B-A
  deltaV=V-W
  if deltaD<0:
    return 'NO'  
  if deltaD==0:
    return 'YES'
  if deltaV<=0:
    return 'NO'
  if deltaV>0:
     if deltaD%deltaV<=1:
        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')
    else:
        for i in range(T):
            A += V
            B += W
            if A >= B:
                return('YES')
        return('NO')
print(main())

Submission status: Wrong Answer

Solution code:
AV = input()
BW = input()
T = int(input())
A = int(AV.split(" ")[0])
V = int(AV.split(" ")[1])
B = int(BW.split(" ")[0])
W = int(BW.split(" ")[1])
if A+V*T >= B+W*T:
    print("YES", end="")
else:
    print("NO", end="")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 13 20:58:10 2020

@author: sd18016
"""

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

if V == W:
    print("NO")
else:
    if B > A:
        kyori = B-A
        miji = V-W
        if miji < 0:
            print("NO")
        else:
            if kyori % miji == 0:
                a = kyori // miji
                if 1 <= a <= T-1:
                    print("YES")
                else:
                    print("NO")
            else:
                print("NO")
    else:
        kyori = A-B
        miji = W-V
        if miji > 0:
            print("NO")
        else:
            if kyori % abs(miji) == 0:
                a = kyori // abs(miji)
                if 1 <= a <= T-1:
                    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())

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

tmp = abs(B - A)
k = B - W
if tmp <= k * T:
    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=int(input())

print(A,V,B,W,T)

if (V-W)*T>=abs(A-B):
  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 > B:
    print('NO')
    exit()  

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

t = (A - B) / (W - V)

if 0 < t <= T:
    print('YES')
    exit()

print('NO')

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]
    
    print(x[0])
    print(x[1])
    
    if x[0] >= x[1]:
      print("YES")
      break
      
    elif j == a-1:
      print("NO")
      break
      
      
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

tmp = abs(B - A) // abs(V - W)

if B > A:
    va = [A + V * t for t in range(tmp, T+1)]
    vb = [B + W * t for t in range(tmp, T+1)]
else:
    va = [A - V * t for t in range(tmp, T+1)]
    vb = [B - W * t for t in range(tmp, T+1)]

va_vb_and = list(set(va) & set(vb))

if va_vb_and:
    print('YES')
    exit()
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())

if A == B:
  print("YES")
elif 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:
in1 = input().split()
in2 = input().split()
in3 = input()
oni = int(in1[0])
onispeed = int(in1[1])
kid = int(in2[0])
kidspeed = int(in2[1])
time = int(in3)
pase = onispeed - kidspeed
flg = True #正の方向
if kid - oni < 0:
  flg = False #負の方向

if flg:
  oniend = (pase * time) + oni
  if (pase <= 0) or (oniend < kid):
    print("NO")  
  else:
    print("YES")
else:
  oniend = (pase * time) - oni
  if (pase <= 0) or (oniend > kid):
    print("NO")  
  else:
    print("YES")

Submission status: Wrong Answer

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

ans ='NO'
for a in range(int(T**0.5)):
    for b in range (int(T**0.5)-a):
        if A + a * V - b * V == B * a:
            ans = 'YES'

print(ans)

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

lange = B - A
s = V - W

res = 0

if s != 0:
    tmp = lange / s
    if tmp.is_integer() and tmp <= T and tmp >= 0:
        res = 1

if (res == 0):
    print("NO")
else:
    print("YES")

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:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

dis = abs(B - A)
speed = abs(V - W)


if dis <= speed*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(V <= W):
	print("NO")
elif(abs(B - A) >= V * T):
	print("NO")
elif(((B - A) % 2 == 1) and ((W - V) % 2 != 1)) or (((B - A) % 2 != 1) and ((W - V) % 2 == 1) and ((V !=1) and (W != 1))):
	print("NO")
else:
	print("YES")

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,V = [int(x) for x in stdin.readline().rstrip().split()]
B,W = [int(x) for x in stdin.readline().rstrip().split()]
T = int(stdin.readline().rstrip())

if W - V == 0:
    print("NO")
else:
    x = (A - B) / (W - V) 
    if not x.is_integer():
        print("NO")
    elif x > T:
        print("NO")

    elif x < 0:
        print("NO")

    else:
        print("YES")

Submission status: Wrong Answer

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int (input())
s = [A, V, B, W, T]
def tag (s):
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int (input())
    if B - A > 0:
        if B - A <= (V - W)*T:
            print ("YES")
        else:
            print ("NO")
    else:
        if A - B <= (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())

A=A/(10**5)
V=V/(10**5)
B=B/(10**5)
W=W/(10**5)
 
if (V-W)*T >=B-A:
    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())

ans ='NO'
for a in range(T):
    for b in range (T-a):
        if A + a * V - b * V == B * a:
            ans = 'YES'

print(ans)

Submission status: Wrong Answer

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

if A == B:
  print("YES")
elif 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())

import math

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

Submission status: Wrong Answer

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

if A==B:
  print("YES")
else:
  if V==W:
    print("NO")
  else:
    x = (B-A) / (V-W)
    if 0 <= x <= 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())
d = abs(a-b)
if w >= v:
    print('NO')
else:
    if d%(v-w)==0:
        print('YES')
    else:
        print('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 V <= W:
  print('NO')
  sys.exit()
t= abs(B-A)%(V-W)
if t == 0 and 0 < abs((B-A)//(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())

distance = abs(a-b)
v_difference = v-w
if v_difference <= 0:
  print('NO')
elif distance % v_difference != 0:
  print('NO')
elif distance > v_difference * t:
  print('NO')
else:
  print('YES')

Submission status: Wrong Answer

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

if W-V!=0:
	if B>A:
		if (A-B)/(W-V)>0 and (A-B)/(W-V)==(A-B)//(W-V) and (A-B)/(W-V)<=T:
			print("YES")
		else:
			print("NO")
	else:
		if (B-A)/(W-V)>0 and (B-A)/(W-V)==(B-A)//(W-V) and (B-A)/(W-V)<=T:
			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())
if V <= W:
	print("No")
	exit()

L=abs(B-A)
vd=abs(V-W)
if L==1:
	print("No")
	exit()

if L <= vd*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 (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 "N")

Submission status: Wrong Answer

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

@author: sd18016
"""

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

if A > B:
    print("NO")
else:
    kyori = B-A
    miji = V-W
    if miji <= 0:
        print("NO")
    else:
        if kyori % miji == 0:
            a = kyori//miji
            if a <= T:
                print("YES")
            else:
                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()

t = (A - B) / (W - V)

if 0 < t <= T:
    print('YES')
    exit()

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):
  print('YES')
else:
  print('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 v>w:
    if abs(a-b)%(v-w)==0:
        if abs(a-b)//(v-w)<=t:
            print("YES")
            sys.exit()
print("NO")

Submission status: Wrong Answer

Solution code:
import sys
a,v = map(int, sys.stdin.readline().rstrip("\n").split())
b,w = map(int, sys.stdin.readline().rstrip("\n").split())
t = int(sys.stdin.readline().rstrip("\n"))
h = 10**9 + 7
if a > b:
    print('NO')
elif v <= w:
    print('NO')
else:
    between = b - a
    speed = w - v
    if between//speed <= 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())
x = b - a
y = v - w
if y <= 0:
    print("NO")
elif x % y == 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 <= 10 ** 9:
        print('YES')
    else:
        print('NO')