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

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

set_position = abs(B-A)
move         = abs(V-W)

for i in range(T):
    set_position -= move

    if set_position== 0:
        print("YES")
        break
    elif set_position < 0:
        print("NO")
        break
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")
            exit()
    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'
kyo=abs(a-b)
so=abs(v-w)

if w>v:
    ans='NO'
elif w==v:
    ans='NO'
elif w<v:
    if kyo>t*so:
        ans='NO'
    elif kyo<=t*so:
        if kyo%so==0:
            ans='YES'
        else:
            ans='NO'
#print(kyo%so)
print(ans)

Submission status: Wrong Answer

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

position_diff = b-a
pace_diff = v-w

if position_diff < 0:
    print('NO')
else:
    if pace_diff <= 0:
        print('NO')
    elif pace_diff > 0:
        if pace_diff * t >= position_diff:
            print('YES')
        else:
            print('NO')

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if a>b or w>=v:
    print('NO')
    sys.exit()
for tt in range(1,t+1):
    res = (w - v) * tt + (b - a)
    if res == 0:
        print('YES')
        sys.exit()

print('NO')

Submission status: Wrong Answer

Solution code:
a = input().split(" ")
b = input().split(" ")
c = int(input())
l = int(a[0])
l = abs(l)
r = int(a[1])
k = int(b[0])
k = abs(k)
s = int(b[1])
if (((r * c) + l) >= ((s * c) + k)):
    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 =[]

A1 = V * T + A 
B1 = W * T + B
if A1 < B1:
    print("NO")

else:
    for i in range(T):
        A = A + V
        B = B + W
    
        if A == B:
            D.append(1)

    #print(D)

    if len(D) >= 1:
        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 (w-v)*t>=abs(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())
P = "NO"
AT = A
BT = B

if V > W:
    if int(A-B) % int(W-V) == 0:
        if B > A:
            for i in range(T):
                if BT > AT:
                    AT = A + V * (i + 1)
                    BT = B + W * (i + 1)
                    if AT == BT:
                        P = "YES"
                        break
                elif AT > BT:
                    AT = A - V * (i + 1)
                    BT = B - W * (i + 1)
                    if AT == BT:
                        P = "YES"
                        break
        if B < A:
            for i in range(T):
                if BT > AT:
                    AT = A - V * (i + 1)
                    BT = B - W * (i + 1)
                    if AT == BT:
                        P = "YES"
                        break
                elif AT > BT:
                    AT = A + V * (i + 1)
                    BT = B + W * (i + 1)
                    if AT == BT:
                        P = "YES"
                        break
                    
print(P)

Submission status: Wrong Answer

Solution code:
oni, oni_spd = list(map(int, input().split()))
child, child_spd = list(map(int, input().split()))
T = int(input())

dist_from_oni = child - oni
ofs_spd = oni_spd - child_spd

if dist_from_oni >= 0 and ofs_spd >= 0:
  if ofs_spd * T >= dist_from_oni:
    print('YES')
  else:
    print('NO')
elif dist_from_oni <= 0 and ofs_spd <= 0:
  if ofs_spd * T < dist_from_oni:
    print('YES')
  else:
    print('NO')
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 A < B and V <= W:
    print('NO')
    sys.exit()
elif B < A and W <= V:
    print('NO')
    sys.exit()    

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

if ans <= T:
    print('YES')
elif ans > T:
    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)
v = V - W
ans = 'YES'

if v <= 0:
  ans = 'NO'
else: 
  if d / v > T:
    ans = 'NO'
    
if (A % 2 != B % 2 and V % 2 != W % 2) and (A % 2 != W % 2 and B % 2 != V % 2):
  ans = 'NO'

  
print(ans)

Submission status: Wrong Answer

Solution code:
#%%

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

if ((b + 1000000000) + w * t) - ((a + 1000000000) + v * 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 a < 0 and b >= 0 :
    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 V - W == 0:
    print('NO')
    exit()

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

# t_j = (B - A) // (V - W)

# print(t)
# print(t_j)

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

# print('NO')

for t in range(1, T + 1):
    A += V * t
    B += W * t
    if A == B:
        print('YES')
        exit()

print('NO')

Submission status: Wrong Answer

Solution code:
import numpy as np
a, v = list(map(int, input().split(' ')))
b, w = list(map(int, input().split(' ')))
t = int(input())

if a > b:
    print('NO')
    exit()

if w >= v:
    print('NO')
    exit()

catchup_speed = (v - w)
start_dis = (b - a)

#対策後
# k = max([int(np.abs(t)), int(np.abs(catchup_speed))])

max_dis = t*catchup_speed

print(max_dis)
print(start_dis)

if start_dis <= max_dis:
# if start_dis <= (k * ((t/k) * (catchup_speed/k))):
    print('YES')
    exit()

print('NO')

Submission status: Wrong Answer

Solution code:
AV = input().split()
BW = input().split()
T = int(input())

a = int(AV[0]) + int(AV[1]) * T
b = int(BW[0]) + int(BW[1]) * T

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

Submission status: Wrong Answer

Solution code:
#鬼
a,v=map(int,input().split())

#逃げている
b,w=map(int,input().split())

#t秒以内
t=int(input())

if v==w:
    print("NO")
    exit()



if (b-a)%(v-w)!=0:
    print("NO")
    exit()

if (b-a)/(v-w)<=t and (b-a)/(v-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())
x1=a+t*v
y1=b+t*w
if((x1>=y1  or a+v>=b+w) and a<=y1):
    print('YES')
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
INF = 1000000000000

a,v = LI()
b,w = LI()
T = I()

if(a > b):
    a,b = b,a
    w,v = v,w
diff = b - a
diff2 = abs(w - v)

if(diff2 == 0):
    print('NO')
else:
    if(diff // diff2 <= T):
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

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

if a==b:
    print("YES")
    exit()
elif v==w:
    print("NO")
    exit()
atai = Decimal(abs(b-a))/Decimal(abs(v-w))
if atai<=t and a+v*atai==b+w*atai:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

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

k = b - a
flag = False

if k >= 0:
    l = T*v - T*w 
    if (k <= l):
        flag = True

if k < 0:
    k = a - b
    l = T*w - T*v
    if (k <= l):
        flag = True


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

Submission status: Wrong Answer

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

d = b - a
d = int(d)
dv = v - w
dv = int(dv)
d = abs(d)
if dv > 0 and abs(d) % abs(dv) == 0 and abs(d) <= abs(dv) * 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 func1(A,V,B,W,T):
    check=0
    for i in range(T):
        if B>A:
            B=B+W
            A=A+V
        elif B<A:
            B=B-W
            A=A-V
        if A==B:
            check=1
            break
    if check==1:
        print("YES")
    else:
        print("NO")
func1(A,V,B,W,T)

Submission status: Wrong Answer

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

v = a[1]
w = b[1]

if a[0] < b[0]:
    if v <= w:
        print('NO')
    else:
        s = v - w
        d = abs(b[0] - a[0])
        if d % s == 0 and d / s <= t:
            print('YES')
        else:
            print('NO')
else:
    if v >= w:
        print('NO')
    else:
        s = w - v
        d = abs(a[0] - b[0])
        if d % s == 0 and d / s <= t:
            print('YES')
        else:
            print('NO')

Submission status: Wrong Answer

Solution code:
import sys

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

ai = []
bi = []

for i in range(t):
    av = a + v * (i+1)
    bw = b + w * (i+1)
    ai.append(av)
    bi.append(bw)

for i in range(t):
    if ai[i] == bi[i]:
        print('YES')
        sys.exit()
print('NO')

Submission status: Wrong Answer

Solution code:
def iput(): return int(input())
def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))

def solve():
    a, v = mput()
    b, w = mput()
    t = iput()
    bit = 0
    if a == b:
        bit = 1
    elif (abs(a-b)/(v+w))%1 == 0 and t >= abs(a-b)/(v+w) >= 0:
        bit = 1
    elif b > a:
        if v > w:
            if ((b-a)/(v-w))%1 == 0 and t >= ((b-a)/(v-w)) >= 0:
                bit = 1
    if bit == 1:
        print("YES")
    else:
        print("NO")
    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

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

k = b - a
flag = False

if k >= 0:
    l = T*v - T*w 
    if (k <= l):
        flag = True

if k < 0:
    k = a - b
    l = T*w - T*v
    if (k <= l):
        flag = True


if (flag == True):
    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 = B-A
mob = W-V

if A == B:
    print("Yes")

else:
    if mob >= 0:
        print("No")
    else:
        if dis % mob != 0:
            print("No")
        else:
            if dis + (mob*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 V-W == 0:
    print("NO")
    import sys
    sys.exit()

# import math
# t = -(A-B)/(V-W)
# if float.is_integer(t):
#     if 1 <= t and t <= math.pow(10, 9):
#         print("YES")
#     else:
#         print("NO")
# else:
#     print("NO")
t = -(A-B)//(V-W)
if A+V*t == B+W*t:
    if t <= 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 abs(a - b) > (v - w) * t:
    print("NO")
else:
    if abs(a - b) % (v - w) == 0:
        print("YES")
    elif (v - w) % abs(a - b) == 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')
  exit()
elif a > b:
  print('YES')
  exit()
  
oni = a + (v*t)
child = b + (w*t)

if (a > b) and (oni > child):
  print('NO')
elif oni >= child:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a = [input() for i in range(3)]
b = list(map(int,a[0].split()))
c = list(map(int,a[1].split()))
t = int(a[2])
a1 = b[0] + (b[1] * t)
b1 = c[0] + (c[1] * t)
if a1 >= b1:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

a=A+X*T
b=B+Y*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())
S=V-W

if S <=0:
   print("NO")
elif (A-B)<=T*S:
   print("YES")
else:
   print("NO")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import string
import math
 
a = list(map(int,input().split()))
b = list(map(int,input().split()))
t = int(input())
flg = False
 
if(b[1] < a[1]):
    for i in range(t):
        if(a[0] > b[0]):
            a[0] -= a[1]
            b[0] -= b[1]
        else:
            a[0] += a[1]
            b[0] += b[1]
            if(a[0]==b[0]):
                flg = True
                break
if(flg):
    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()
for i in range(1, int(t)+1):
  m = a + v*i
  n = b + w*i
  if m == n:
    print('Yes')
    break
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 ((xint-1),T+1):
                if A<B:
                    A=A+V
                    B=B+W
                else:
                    A=A-V
                    B=B-W
                if A==B:
                    ans=1
                    break

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

Submission status: Wrong Answer

Solution code:
A,V = list(map(int, input().split()))
B,W = list(map(int, input().split()))
T = int(input())
T0 = 0
L = abs(A - B)

if W >= V:
  print('NO')
else:
  while 1:
    dT = L // (V - W) + 1
    if L % (V - W) == 0 and dT + T0 <= T:
      print('YES')
      break
    elif T0 + dT >= T:
      print('NO')
      break
    else:
      T0 = T0 + dT
      L = dT * (V - W) - L

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

kyori = abs(B-A)
miji = abs(W-V)
if V == W:
    print("NO")
else:
    if (B-A <0 and W-V<0) or (B-A>0 and W-V>0):
        print("NO")
    else:
        if kyori % miji == 0:
            a = kyori // miji
            if 1 <= a <= 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())
'''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')'''
if v-w != 0 and w-v != 0:
    '''if a-b > 0:'''
    if (a-b)/(w-v) <= t and (a-b)/(w-v) >= 1:
        print('YES')
    else:
        print('NO')
    '''elif b-a > 0:
        if (b-a)/(v-w) <= t and (b-a)/(v-w) >= 1:
            print('YES')
        else:
            print('NO')
    else:
        print('NO')'''
else:
    print('NO')
'''    if not b-a > 0 and w-v > 0:
        if (a-b)/(v-w) > t:
            print('NO')
        elif (a-b)/(w-v) < t:
            print('YES')
        else:
            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>0:
    ArriveTime = (A-B)/(V-W)
else:
    ArriveTime = 10000000000

if T >= ArriveTime:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


kyo = abs(b - a)
ti = v - w

if w >= v or kyo % ti !=  0:
    print("NO")
    exit()


for _ in range(t):
    kyo = kyo - ti
    if kyo == 0:
        print("YES")
        exit()

print("NO")

Submission status: Wrong Answer

Solution code:
AV = [int(x) for x in input().split()]
BW = [int(x) for x in input().split()]
A = AV[0]
V = AV[1]
B = BW[0]
W = BW[1]
T = int(input())
T = float(T)
D = abs(A-B)
S = V-W

if S>0:
    T1 = float(D/S)
    if T1<=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())
seen = []
l,r = 0, T
while r>=l:
  m = l + (r - l) // 2
  if m in seen:
    print("NO")
    exit()
  else:
    seen.append(m)

  if A+V*m == B+W*m:
    print("YES")
    exit()

  if A+V*m > B+W*m:
    r = m
  else:
    l = m

print("NO")

Submission status: Wrong Answer

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

if ans == "YES":
    for _ in range(1, T+1):
        A += V
        B += W
        if A == B:
            break
        if lead == "B":
            if A > B:
                ans = "NO"
                break
        else:
            if A < B:
                ans = "NO"
                break
print(ans)

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()
elif a > b:
  print('YES')
  exit()
  
oni = a + (v*t)
child = b + (w*t)

if (a < b) and (oni < child):
  print('NO')
elif oni >= child:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
try:
    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")
except EOFError:
    pass

Submission status: Wrong Answer

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

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

if (V <= W):    #逃げるほうが早い→鬼が端に到達するまでの時間を求める
    if (A < B):
        time = (10**9-A)/V
    else:
        time = (10**9+A)/V
else:
    if (A < B): #鬼の方が早い→途中で追いつくor端まで逃げ切る
        if ((10**9 - B)/W > timeyosou): #逃げが端まで行くのにかかる時間　＞　鬼が追いつく時間　→鬼は追いつく
           time = timeyosou
        else:
            time = (10**9 - A)/V    #そうでないとき→鬼が端までたどり着く時間
    else:
        if ((10**9 + B)/W > timeyosou):
           time = timeyosou
        else:
            time = (10**9 + A)/V
if (T >= time):
    print ("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
#DEMON# 
RD, SD = map(int, input().split())
#CRIMINAL#
RC, SC = map(int, input().split())

T = int(input())

A = SD * T
B = SC * T

AD = RD + A

AC = RC + B

if AD < AC:
  print("NO")
else:
  print("YES")

Submission status: Wrong Answer

Solution code:
def iput(): return int(input())
def mput(): return map(int, input().split())
def lput(): return list(map(int, input().split()))

def solve():
    a, v = mput()
    b, w = mput()
    t = iput()
    bit = 0
    if a == b:
        bit = 1
    elif (abs(a-b)/(v+w))%1 == 0 and t >= abs(a-b)/(v+w) >= 0:
        bit = 1
    elif b > a:
        if v > w:
            if ((b-a)/(v-w))%1 == 0 and t >= ((b-a)/(v-w)) >= 0:
                bit = 1
        if w > v:
            if ((b-a)/(w-v))%1 == 0 and t >= ((b-a)/(w-v)) >= 0:
                bit = 1
    else:
        if w > v:
            if ((a-b)/(w-v))%1 == 0 and t >= ((a-b)/(w-v)) >= 0:
                bit = 1
        if v > w:
            if ((a-b)/(v-w))%1 == 0 and t >= ((a-b)/(v-w)) >= 0:
                bit = 1
    if bit == 1:
        print("YES")
    else:
        print("NO")
    return 0

if __name__ == "__main__":
    solve()

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)
v = V - W
ans = 'YES'

if v <= 0:
  ans = 'NO'
else: 
  if d / v > T:
    ans = 'NO'
    
if A % 2 != B % 2 and V % 2 != W % 2:
  ans = 'NO'
  
print(ans)

Submission status: Wrong Answer

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

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

result = False

if v == w:
    print("NO")
    import sys
    sys.exit()

try:
    if b > a:
        time = (b-a)/(v-w)
    else:
        time = (b-a)/(w-v)
except:
    result = False

# print("time:{}, t:{}".format(time, t))

if time.is_integer():
    result = True

if time > t:
    result = False

if time < 0:
    result = False

if result:
    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 _ in range(1):
    if a == b:
        c = 10**20
        break
    if v == w or v < w:
        c = 10**20
        break
    if v > w:
        c = abs(a-b)/(v-w)
        break
    
if int(c) <= t:
    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())
flag = "NO"
mid = T//2
i = 1
while True:
    i += 1
    a = A + W*mid
    b = B + V*mid
 
    if a == b:
        flag = "YES"
        break
    elif T//(2**(i-1)) == 0:
        break
    elif T//(2**i) == 0:
        if a > b:
            mid = mid - 1
        elif a < b:
            mid = mid + 1
    elif a > b:
        mid = mid - T//(2**i)
    elif a < b:
        mid = mid + T//(2**i)

print(flag)

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('No')
    exit()

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

Submission status: Wrong Answer

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

if ((b + w * t) + 1000000000) - ((a + v * t) + 1000000000) <= 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 + (V * T) > B + (W * T)):
  print('YES')
elif (A < B and A + (V * T) >= B + (W * T)):
  print('YES')
elif (A > B and A - (V * T) <= B - (W * T)):
  print('YES')
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())
flag = 0
while t>0:
	A = A+V
	B = B+W
	if A == B:
		flag = 1
		print("YES")
		break
	t = t - 1
if flag == 0:
	print("NO")

Submission status: Wrong Answer

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

if S <=0:
   print("NO")
elif (A-B)/S<=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())
Flag = False
if A<B:
    for TT in range(0,T+1):
        A = A+V
        B = B+W
        if A==B:
            Flag = True
            break
else:
    for TT in range(0,T+1):
        A = A-V
        B = B-W
        if A==B:
            Flag = True
            break
if Flag:
    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:
  result = "NO"
else:
  if V - W > 0:
    if B - A - T * (V - W) <= 0:
      for i in range(T + 1):
        if B - A - i * (V - W) == 0:
          result = "YES"
          break
        else:
          result = "NO"
    else:
      result = "NO"
  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())

distance = b - a
speed_remainder = v - w

if distance - t * speed_remainder <= 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 (b-a)//(w-v)<=t:
            print("YES")
            exit()
    print("NO")

Submission status: Wrong Answer

Solution code:
from decimal import *
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
getcontext().prec=20
if A==B:
    print("YES")
elif A<B:
    if (V>W):
        if 0<=B-A<=T*(V-W):
            print("YES")
        else:
            print("NO")
    elif (V<=W):
        print("NO")
else:   #B>A
    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('No')
    exit()

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

Submission status: Wrong Answer

Solution code:
#鬼
a,v=map(int,input().split())

#逃げている
b,w=map(int,input().split())

#t秒以内
t=int(input())

if v==w:
    print("NO")
    exit()

from fractions import gcd
g=gcd(v,w)
v=v//g
w=w//g

if (b-a)%(v-w)!=0:
    print("NO")
    exit()

    

if (b-a)/(v-w)<=t*g and (b-a)/(v-w)>0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
INF = 1000000000000

a,v = LI()
b,w = LI()
T = I()

if(a > b):
    a,b = b,a
    w,v = v,w
diff = b - a
diff2 = w - v

if(diff2 == 0):
    print('NO')
else:
    if(diff % abs(diff2) != 0):
        print('NO')
    else:
        if(diff // abs(diff2) <= 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 w > v:
    print("NO")

oni = v*t
nige = w*t
sa = abs(b-a)

if oni - nige < sa:
    print("YES")
else:
    print("NO")