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

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

if B < A:
  print("NO")
elif dis <= speed*T and dis % speed == 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 A==B:
  print("YES")
else:
  if V==W:
    print("NO")
  else:
    x = (B-A) / (V-W)
    if x <= 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_del = min(t*w, 10 ** 9-b)
    a_del = min(t*v, 10 ** 9-a)
    if b_del+b > a_del+a:
        print("NO")
    else:
        print("YES")


else:
    b_del = min(t*w, b+10 ** 9)
    a_del = min(t*v, a+10 ** 9)
    if b-b_del < a-a_del:
        print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

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

if A < B and V > W and 0 < V and 0 < W and (V-W)*T >= B-A and (B-A) % (V-W) == 0 or A == B:
    for t in range(T):
        if a == b:
            print('YES')
            break
        a+=V
        b+=W
else:
    print('NO')

Submission status: Wrong Answer

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

A = int(a[0])
V = int(a[1])
B = int(b[0])
W = int(b[1])
T = int(c)

if (B>A):
	if(W>=V):
		print("NO")
	else:
		times = (B-A) / (V-W)
		if(times <= T):
			print("YES")
		else:
			print("NO")
else:
	if(V>=W):
		print("NO")
	else:
		times = (A-B) / (W-V)
		if(times <= 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%(w-v)==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())

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==0 and float(T)>=float(deltaD/deltaV):
        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 b-a>=0:
  if (v-w)*t >= b-a:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

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'
  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:
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:
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
	
	if d_dist * 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())
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:
str1 = input()
str2 = input()
str3 = input()

A = str1.split(" ")
B = str2.split(" ")
C = int(str3)
res = ""

# A：追いかける。鬼。
# B：逃げる。追われる。
if int(A[1]) <= int(B[1]):
    res = "NO"
else:
    # 距離差
    diff = abs(int(B[0]) - int(A[0]))
    print(diff)    
    # 速度差
    speedDiff = abs(int(A[1]) - int(B[1]))
    print(speedDiff)
    if speedDiff * C < diff:
        res = "NO"
    else:
        res = "YES"


print(res)

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:
# -*- coding: utf-8 -*-
import sys
import math
sys.setrecursionlimit(10000)

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

    if b > a:
        a = a + math.ceil(time) * v
        b = b + math.ceil(time) * w
    else:
        a = a - math.ceil(time) * v
        b = b - math.ceil(time) * w

    onigokko(a, v, b, w)


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 tag(a,b,v,w,t):
    if w>=v:
        return "NO"
    res = (a+(v*t*2))-(b+(w*t*2))
    if res<0:
        return "NO"
    return "YES"

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

daplus = a + v*t
daminus = a - v*t

if daplus < daminus:
    tmp = daplus
    daplus = daminus
    daminus = tmp

dbplus = b + w*t
dbminus = b - w*t

if dbplus < dbminus:
    tmp = dbplus
    dbplus = dbminus
    dbminus = tmp


flag = 0

#aが鬼

if(daminus <= dbplus & dbplus <= daplus):
    flag += 1
if(daminus <= dbminus & dbminus <= daplus):
    flag += 1

print(flag)

if flag == 2:
    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:
A, V= (int(x) for x in input().split())
B, W = (int(x) for x in input().split())
T = int(input())
for i in range(1,T+1):
    if (A < B and V <= W) or (A > B and V >= W):
        print("NO")
        break;    
    d = (B-A)-((V-W)*i)
    if d == 0:
        print("YES")
        break;
    elif d != 0 and i == T:
        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())

oni = a + v * t
nige = b + w * t

if oni == nige:
    print('YES')
    sys.exit()

if a <= b:
    if v <= w:
        print('NO')
    elif oni >= nige:
        for i in range(int(t/2)):
            a = a + v
            b = b + w
            oni = oni - v
            nige = nige - w
            if oni == nige or a == b:
                print('YES')
                sys.exit()
            elif oni <= nige or a >= b:
                print('NO')
                sys.exit()
    else:
        print('NO')
else:
    if v >= w:
        print('NO')
    elif oni <= nige:
        for i in range(int(t/2)):
            a = a + v
            b = b + w
            oni = oni - v
            nige = nige - w
            if oni == nige or a == b:
                print('YES')
                sys.exit()
            elif oni >= nige or a <= b:
                print('NO')
                sys.exit()
    else:
        print('NO')

Submission status: Wrong Answer

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

for num in range(t):
    a+=v
    b+=w
    if a==b:
        counter+=1

if counter==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())

lange = A - B
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:
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')
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')
    exit()

time = (b-a) / (v-w)

if (b-a) % (v-w) == 0:
    if time > 0 and time < t:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot,
                  log2, pi, radians, sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits


def inp():
    return(int(input()))


def inlist():
    return(list(map(int, input().split())))


def instr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


a, v = invr()
b, w = invr()
t = inp()
if a < 0 and b < 0:
    a = a*-1
    b = b * -1


if v - w != 0:
    t2 = (a - b) / (w - v)
    if b < a:
        d = 0 - b
        a = a + d
        b = b + d
        t2 = -(a-b) / (w + v)
        if t2 > 0:
            print("NO")
            sys.exit()
        if abs(t2) <= t:
            print("YES")
        else:
            print("NO")
    else:
        if t2 >= 0 and t2 <= 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')
else:
    if ((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())
import sys
x = 0
while x<t:
    if a+v == b+w:
        print('YES')
        sys.exit()
    else:
        a = a+v
        b = b+w
        x = x+1
print('NO')

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))  # a[0] a[1]
b = list(map(int, input().split())) 
t = int(input()) 

if a[0] < b[0] :
  if a[1] * t + a[0] - b[1] * t - b[0] >= 0 : 
    print("YES")
  else :
    print("NO")
elif b[0] < a[0] :
  if a[1] * t + a[0] - b[1] * t - b[0] <= 0 :
    print("YES")
  else :
    print("NO")

Submission status: Wrong Answer

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

a = int(a)
v = int(v)
b = int(b)
w = int(w)

t = int(input())

s=""

for i in range(t):
  a = a + v
  #print(str(a)+"_"+str(i))
  if a <= b:
    s = "YES"
    print(s)
    break
    
  else:
    pass
  
  b = b + w

if s=="":
	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())
for i in range(1,T+1):
    if (A < B and V <= W) or (A > B and V >= W):
        print("NO")
        break;    
    d = (B-A)-((V-W)*i)
    if d <= 0:
        print("YES")
        break;
    elif d >= 0 and i == T:
        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)):
	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 A==B:
  print("YES")
else:
  if V==W:
    print("NO")
  else:
    if (B-A) % (V-W) != 0:
      print("NO")
    else:
      x = (B-A) / (V-W)
      print(x)
      if x <= T:
        print("YES")
      else:
        print("NO")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
sys.setrecursionlimit(10000)

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)
        a += math.ceil(time) * v
        b += math.ceil(time) * w
    else:
        time = (b-a)/(w-v)
        a -= math.ceil(time) * v
        b -= math.ceil(time) * w

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

    onigokko(a, v, b, w)


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 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-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= (int(x) for x in input().split())
B, W = (int(x) for x in input().split())
T = int(input())
for i in range(1,T+1):
    if (A < B and V <= W) or (A > B and V >= W):
        print("NO")
        break;    
    d = (B-A)-((V-W)*i)
    if d <= 0:
        print("YES")
        break;
    elif d != 0 and i == T:
        print("NO")

Submission status: Wrong Answer

Solution code:
a, a_v = map(int, input().split())
b, b_v = map(int, input().split())
t = int(input())
flag = 0
t_set = 0
if a > b:
  temp = a
  a = b
  b=temp
  
  temp_v = a_v
  a_v = b_v 
  b_v = temp_v

  
v = a_v - b_v
l = b - a

if v<0:
  v*(-1)
if l<0:
  l*(-1)

if l==0:
  print('YES')
elif v==0:
  print('NO')
elif v*t>=l and l%v == 0:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

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

if A < B:
    if a >= b:
        print("YES")
    else:
        print("NO")
else:
    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())
P = 0
if (-10**9 <= A <= 10**9) and (-10**9 <= B <= 10**9) and (1 <= V <= 10**9) \
and  (1 <= W <= 10**9) and (1 <= T <= 10**9) and (A != B) and type(A) == int and\
type(B) == int and type(V) == int and type(W) == int and type(T) == int:
    
    while P != T: 
        if A > B:
            A -= V
            B -= W
            P+=1
        
        elif A < B:
            A += V
            B += W
            P+=1

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

Submission status: Wrong Answer

Solution code:
import sys
from decimal import Decimal
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if V <= W:
  print('NO')
  sys.exit()
t= (Decimal(B)-Decimal(A))%(Decimal(V)-Decimal(W))
if t == 0 and abs(Decimal(B)-Decimal(A))//(Decimal(V)-Decimal(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())

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

if B < A:
  print("NO")
elif dis <= speed*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)
else:
  print(n)

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-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(float,input().split())
b,w=map(float,input().split())
t=float(input())
b = max(a,b)
a = min(a,b)
gap = abs(b-a)
v_gap = abs(v-w)
if v>w: 
  if v_gap*t>=gap:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

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)

va = [A + V * t for t in range(tmp, T+1)]
va.extend([A - V * t for t in range(tmp, T+1)])
vb = [B + W * t for t in range(tmp, T+1)]
vb.extend([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 = input().split()
b,w = input().split()

a = int(a)
v = int(v)
b = int(b)
w = int(w)

t = int(input())

s=""

for i in range(t):
  a = a + v
  #print(str(a)+"_"+str(i))
  if a == b:
    s = "YES"
    print(s)
    break
    
  else:
    pass
  
  b = b + w

if s=="":
	print("NO")

Submission status: Wrong Answer

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

lange = A - B
s = V - W

res = 0

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

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

Submission status: Wrong Answer

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


# 移動可能距離を計算
a_move = int(T) * int(V)
b_move = int(T) * int(W)

# aとbの位置関係を考える
if int(A) < int(B):
    # a -> b
    # 追い詰めることが可能な距離にいる場合は問答無用で捕まえられる
    if int(A) + a_move >= 10 ** 9 and int(B) + b_move >= 10 ** 9:
        print("YES")
    else:
        if int(A) + a_move >= int(B) + b_move:
            print("YES")
        else:
            print("NO")
else:
    # b -> a
    if int(A) - a_move <= -(10 ** 9) and int(B) - b_move <= -(10 ** 9):
        print("YES")
    else:
        if int(A) - a_move <= int(B) - b_move:
            print("YES")
        else:
            print("NO")

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))  # a[0] a[1]
b = list(map(int, input().split())) 
t = int(input()) 

if a[0] < b[0] :
  if a[1] * t + a[0] - b[1] * t - b[0] > 0 : 
    print("YES")
  else :
    print("NO")
elif b[0] < a[0] :
  if a[1] * t + a[0] - b[1] * t - b[0] < 0 :
    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 (2):
                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())
if v == w:
    print('NO')
else:
    if ((b - a) / (v - w)) < 1:
        print('NO')
    elif ((b - a) / (v - w)) <= t:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot,
                  log2, pi, radians, sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits


def inp():
    return(int(input()))


def inlist():
    return(list(map(int, input().split())))


def instr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


a, v = invr()
b, w = invr()
t = inp()
if a < 0 and b < 0:
    a = a*-1
    b = b * -1


if v - w != 0:
    t2 = (a - b) / (w - v)
    if b < a:
        d = 0 - b
        a = a + d 
        b = b + d
        t2 = -(a-b) / (w + v)

        if abs(t2) <= t:
            print("YES")
        else:
            print("NO")
    else:
        if t2 >= 0 and t2 <= 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*T >= (B - A) + (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)*T >=B-A:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A, B = list(map(int,input().split(" ")))
V, 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())

if a < b:
  if w < v and (b-a)%(v-w)==0 and int((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 A==B:
    print('YES')
elif W>=B:
    print('NO')
elif abs(A-B)>T*(V-W):
    print('NO')
elif 2*W==V and abs(A-B)%W==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())
import sys
x = 0
while x<=t:
    if a == b:
        print('YES')
        sys.exit()
    else:
        a = a+v
        b = b+w
        x = x+1
print('NO')

Submission status: Wrong Answer

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

if A < B and V > W and 0 < V and 0 < W and (V-W)*T >= B-A and (B-A) % (V-W) == 0 or A == B:
    print('YES')
elif 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 = float(input())

if (B - A)  <= T * (V - W):
    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)
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')
else:
    if -1 < ((b - a) / (v - w)) < 1:
        print('NO')
    elif -t <= ((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())
cnt = 0
for tt in range(1, t + 1):
    res = (v-w) * tt - (b - a)
    if res == 0:
        cnt = 1

if a >= b and w >= v:
    cnt = 0
if cnt == 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)
else:
  print(y)
print(A,B)

Submission status: Wrong Answer

Solution code:
a, a_v = map(int, input().split())
b, b_v = map(int, input().split())
t = int(input())
flag = 0
t_set = 0
if a > b:
  temp = a
  a = b
  b=temp
  
  temp_v = a_v
  a_v = b_v 
  b_v = temp_v

  
v = a_v - b_v
l = b - a

if l==0 or (a_v * b_v)<0:
  print('YES')
elif v==0:
  print('NO')
elif v*t>=l and l%v == 0:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
a,v=map(float,input().split())
b,w=map(float,input().split())
t=float(input())
b = max(a,b)
a = min(a,b)
gap = abs(v-w)
if v>w:
  c=(b-a)/gap
  if t>=c:
    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 (B - A)  <= 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())

if v<w and a<b:
  print("NO")
  exit()
elif v>w and a>b:
  print("NO")
  exit()
elif v==w:
  print("NO")
  exit()
  
if abs(b-a)%abs(v-w)==0 and abs(b-a)/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())
flag = False

if a<=b and v <= w:
    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')