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 = [int(a) for a in input().split()]
b, w = [int(a) for a in input().split()]
t = int(input())


ls = sorted([a, b])
distance = abs(ls[1]-ls[0])

ds = v - w

ans = ""
if (ds * t) <= (distance):
  ans = "NO"
else:
  ans = "YES"
print(ans)

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+V*T > B+W*T:
        print('NO')
        exit(0)
    for a,b in zip(range(A, A+V*T+T, V),range(B, B+W*T+T, W)):
        if a == b:
            print('YES')
            exit(0)
        if a > b:
            print('NO')
            exit(0)
    print('NO')
main()

Submission status: Wrong Answer

Solution code:
import sys

a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
kyori = b - a
hayasa = v - w
for tt in range(1, t + 1):
    res = kyori - hayasa * tt
    if res == 0:
        print('YES')
        sys.exit()
    elif res<0:
        sys.exit()

print('NO')

Submission status: Wrong Answer

Solution code:
N,S = map(int,input().split())
n,s = map(int,input().split())
T = int(input())

dis = n - N
speed = S - s

if n < N:
  print("NO")
elif 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())

distance = b - a
speed_remainder = v - w

if distance <= 0:
    print("NO")
elif distance <= t * speed_remainder:
    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_place = a
b_place = b
if w >= v:
    print('No')
else:
    for i in range(1,t+1):
        a_place += v
        b_place += w
        if a_place == b_place:
            print('Yes')
            break

Submission status: Wrong Answer

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

    ans = 'NO'

    if V > W:
        t = abs((B-A)/(V-W))
        if t <= T and is_integer(t):
            print(t)
            ans = 'YES'

    print(ans)

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
a, v = [float(s) for s in input().split(" ")]
b, w = [float(s) for s in input().split(" ")]
t = float(input())

if v == w:
  print("NO")
else:
  if a > b and v >= w:
    print("NO")
  elif b > a and w >= v:
    print("NO")
  else:
    l = abs(b - a)
    k = abs(v - w)
    if k * t >= l:
      print("YES")
    else:
      print("NO")

Submission status: Wrong Answer

Solution code:
import math
import sys
a,v=(int(x) for x in input().split())
b,w=(int(x) for x in input().split())
t = int(input())

e1=pow(10, -9)
e2=pow(10, 9)

if (a<e1)or(e2<a)or(b<e1)or(e2<b)or(v<1)or(e2<v)or(w<1)or(e2<w)or(t<1)or(e2<t)or(a==b):
    sys.exit(0)



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

Submission status: Wrong Answer

Solution code:
a, v = [int(a) for a in input().split()]
b, w = [int(a) for a in input().split()]
t = int(input())


ls = sorted([a, b])
distance = abs(ls[1]-ls[0])

ds = v - w


print(distance)
print(ds)


ans = ""
if (ds * t) <= (distance):
  ans = "NO"
else:
  ans = "YES"
print(ans)

Submission status: Wrong Answer

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

if V*T <= W*T:
    print("NO")
elif A > B:
    if A - V*T > B - W*T:
        print ("NO")
    else:
        print("YES")
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:
    a,b = b,a
    v,w = w,v
if v<=w:
    print('NO')
elif (b-a)/(v-w)<=t and (b-a)/(v-w)==(b-a)//(v-w):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a, b= map(int,input().split(' '))
c,d=map(int,input().split(' '))
e=int(input())

if (a+(b*e))>=(c+(d*e)):
    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(T):
    if V == W:
        print('NO')
        break
    elif (V-W)*i == (B-A):
        print('YES')
        break

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

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

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

Submission status: Wrong Answer

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

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

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()
  
dis = abs(a-b)
vdis = abs(v-w)
x = vdis * t
if dis <= x:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

Solution code:
import sys

la = list(map(int, input().split()))
lb = list(map(int, input().split()))
t = int(input())


dis = 0
if la[0] >= 0 and lb[0] >= 0:
    dis =  abs(la[0] - lb[0])
elif la[0] <= 0 and lb[0] <= 0:
    dis =  abs(la[0] + lb[0])
else:
    dis = abs(la[0])+abs(la[0])

if la[1] - lb[1] > 0:
    if dis / (la[1] - lb[1]) <= t:
        print("YES")
        sys.exit()
print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def tag(a,b,v,w,t):
    return "NO"

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

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = int(input())
e = a[1]-b[1]

aa = a[0]+a[1]*c
bb = b[0]+b[1]*c
d = aa-bb
if e == 0 or e <= 0:
  print("NO")
else:  
  if aa >= bb:
    if d % e == 0:
      print("YES")
    else:
      print("NO")
  else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import math
import sys
a,v=(int(x) for x in input().split())
b,w=(int(x) for x in input().split())
t = int(input())

e1=pow(10, -9)
e2=pow(10, 9)

if (a<e1)or(e2<a)or(b<e1)or(e2<b)or(v<1)or(e2<v)or(w<1)or(e2<w)or(t<1)or(e2<t)or(a==b):
    sys.exit(0)



if (b-a+(w-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 V > W:
  if T > (B - A) % (V - W):
    print('YES')
else:
  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

v = a_v - b_v
l = b - a

if l==0:
  print('YES')
elif v==0:
  print('NO')
elif l%v==0:
  if int(l/v)<=t:
    print('YES')
  else:
    print('NO')
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())
  ans = True

  a_can_plus = min(a + v * t, 10 ** 8)
  a_can_minus = max(a - v * t, -10 ** 8)
  b_can_plus = min(b + w * t, 10 ** 8)
  b_can_minus = max(b - w * t, -10 ** 8)

  if v - w < 0: 
    ans  = False
  elif (v - w) * t >= abs(a - b):
    ans = True
      
  if ans:
    print("YES")
  else:
    print("NO")            


main()

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:
     if deltaV==0:
        return 'NO'
     elif T>=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 v == w :print('NO')
elif w > v: 
    print('NO')
elif (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())
velocity = w-v
dist = b-a
if velocity == 0:
    print('NO')
elif (a < b) and (v < w):
    print('NO')
elif a > b :
    print('NO')
elif abs(dist) % abs(velocity) == 0 and abs(dist // velocity) <= 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 (2):
                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 = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

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

t = (B-A)//(V-W)
# print("t=",t)
# print("A+Vt=", A+V*t)
# print("B+Wt=", B+W*t)

if A+V*t == B+W*t:
    if 1 <= t and t <= 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()
d = abs(b-a)

if abs(v - w) > 0:
    t2 = (a - b) / (w - v)

    if t2 >= 0 and t2 <= t:
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys

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

    out = 'NO'
    if V==W:
        if B==A:
            out = 'YES'
            print(out)
            sys.exit()
        else:
            print(out)
            sys.exit()

    t = (B - A) / (V - W)
    if t >= 0:
        if t<=T:
            out = 'YES'
    
    print(out)
main()

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:
        print("NO")
        break;
    d = (B-A)-((V-W)*i)
    if d == 0:
        print("YES")
        break;
    elif i == (T+1):
        print("NO")
        break;

Submission status: Wrong Answer

Solution code:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
re1 = (t*v) - a
re2 = (t*w) - b
if re1 >= re2 :
    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:
  if T >= (B - A) % (V - W):
    print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
a, v = list(map(float, input().split()))
b, w = list(map(float, input().split()))
t = float(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')
            exit()
    else:
        print('NO')
        exit()

Submission status: Wrong Answer

Solution code:
import math
import sys
a,v=(int(x) for x in input().split())
b,w=(int(x) for x in input().split())
t = int(input())

e1=pow(10, -9)
e2=pow(10, 9)

if (a<e1)or(e2<a)or(b<e1)or(e2<b)or(v<1)or(e2<v)or(w<1)or(e2<w)or(t<1)or(e2<t)or(a==b):
    sys.exit(0)



if ((b-a)/t+w-v <= 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())
kyori = b - a
for tt in range(1, t + 1):
    if kyori + (w - v) * tt == 0:
        print('YES')
        sys.exit()

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:
    if 10**9+a<=t*v:
        print("YES")
        sys.exit()
    zb = b-t*w
    if zb<-(10**9):
        zb=-(10**9)
    if zb<a-v*t:
        print("NO")
        sys.exit()
    if zb>=a-v*t:
        print("YES")
        sys.exit()
if a<b:
    if 10**9-a<=t*v:
        print("YES")
        sys.exit()
    zb=t*w+b
    if zb>=10**9:
        zb=10**9
    if zb>t*v+a:
        print("NO")
        sys.exit()
    if zb<=t*v+a:
        print("YES")
        sys.exit()

Submission status: Wrong Answer

Solution code:
A, V = list(map(int,input().split()))
B, W = list(map(int,input().split()))
T = int(input())
if (V-W) < 1 or (V-W)*T < (B-A):
  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"
if b-a>0 and v-w>0 and (b-a)/(v-w)%1==0 and (b-a)/(v-w)<=t:
    ans = "YES"
elif b-a<0 and v-w<0 and (b-a)/(v-w)%1==0 and (b-a)/(v-w)<=t:
    ans = "YES"
print(ans)

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 math import gcd
g=gcd(v,w)
v=v//g
w=w//g

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

la = list(map(int, input().split()))
lb = list(map(int, input().split()))
t = int(input())

if lb[1] == 0 and la[1] > 0:
    print("YES")
    sys.exit()

dis = 0
if la[0] >= 0 and lb[0] >= 0:
    dis =  abs(la[0] - lb[0])
elif la[0] <= 0 and lb[0] <= 0:
    dis =  abs(la[0] + lb[0])
else:
    dis = abs(la[0])+abs(la[0])

if la[1] - lb[1] > 0:
    if dis / (la[1] - lb[1]) <= t:
        print("YES")
        sys.exit()
print("NO")

Submission status: Wrong Answer

Solution code:
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #B
    #input
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    #output
    #A < Bの時
        #V <= Wであれば、相手はひたすら逃げれば良く、この時鬼は相手を捕まえられない。
        #V > Wであれば、鬼は1秒に相手との距離をV-Wだけ詰められる。
        #B-A//V-WがTより小さいか同じ場合は鬼は相手を捕まえられる。
    #A > Bの時
        #上の議論とほぼ同じ。

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

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    A, V = map(int,input().split())
    B, W = map(int,input().split())
    T = int(input())
    for a,b in zip(range(A, A+V*T+T, V),range(B, B+W*T+T, W)):
        if a == b:
            print('YES')
            exit(0)
        if a > b:
            print('NO')
            exit(0)
    print('NO')
main()

Submission status: Wrong Answer

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
ans=0
if a + v * t == b + w * t:
  ans='YES'
else:
  ans='NO'
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 V == W:
    print("NO")
    exit()

if V < W:
    if T * (W - V) <= B - A and B - A <= 0:
        print("YES")
    else:
        print("NO")
else:
    if 0 <= B - A and B - A <= T * (V -W):
        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(b-a)/Decimal(v-w)
if atai<=t and (a+v*t>=b+w*t or a+v*t>=b-w*t):
    print("YES")
else:
    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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b= map(int,input().split(' '))
c,d=map(int,input().split(' '))
e=int(input())
 
if (a+(b*e))>=(c+(d*e)):
    print('YES')
if (a+(b*e))<(c+(d*e)):
    print('NO')
if a>c:
    if (a-(b*e))<=(c-(d*e)):
        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 B > A and B != A + V:
    print('NO')
    exit()
elif A > B and B != A - V:
    print('NO')
    exit()
for t in range(1, T+1):
    if B > A:
        B = B + W
        A = A + V
    else:
        B = B - W
        A = A - V
    if A == B:
        print('Yes')
        exit()
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())
  ans = True

  a_can_plus = min(a + v * t, 10 ** 8)
  a_can_minus = max(a - v * t, -10 ** 8)
  b_can_plus = min(b + w * t, 10 ** 8)
  b_can_minus = max(b - w * t, -10 ** 8)
  # print(a_can_plus)
  # print(a_can_minus)
  # print(b_can_plus)
  # print(b_can_minus)

  if v - w < 0: 
    ans  = False
  elif (v - w) * t > abs(a - b):
    ans = True
  elif a > b:
    if b_can_minus < a_can_minus:
      ans = True
    else:
      ans = False  
  elif a < b:
    if a_can_plus < b_can_plus:
      ans = True
    else:
      ans = False
      
  if ans:
    print("YES")
  else:
    print("NO")            


main()

Submission status: Wrong Answer

Solution code:
import sys

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

    out = 'NO'
    if V==W:
        print(out)
        sys.exit()
        
    t = (B - A) / (V - W)
    if t >= 0:
        if t<=T:
            out = 'YES'
    
    print(out)
main()

Submission status: Wrong Answer

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

for i in range (1, t+1):
    if a+ i*v == b+ i*w:
        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())

distance = b - a
speed_remainder = v - w

if distance <= t * speed_remainder:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
l1 = list(map(int, input().split(" ")))
oni_start = l1[0]
oni_v = l1[1]
l2 = list(map(int, input().split(" ")))
nige_start = l2[0]
nige_v = l2[1]
t = int(input())
if oni_v != nige_v:
    if nige_start>oni_start:
        a = nige_start-oni_start
        if oni_v>nige_v and a/(oni_v-nige_v)<=t:
            print("YES")
        elif 10**9-oni_start<=t*oni_v:
            print("YES")
        else:
            print("NO")
    else:
        a = nige_start-oni_start
        if oni_v>nige_v and a/(oni_v-nige_v)<=t:
            print("YES")
        elif -(-10**9-oni_start)<=t*oni_v:
            print("YES")
        else:
            print("NO")
else:
    if nige_start>oni_start:
        if (10**9-float(oni_start))/oni_v<=float(t):
            print("YES")
        else:
            print("NO")
    elif nige_start<oni_start:
        if (10**9+float(oni_start))/oni_v<=float(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())

position_diff = b - a
pace_diff = v - w

if pace_diff <= 0:
    print('NO')
elif pace_diff > 0:
    if position_diff < 0:
        print('NO')
    else:
        if pace_diff * t >= position_diff:
            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+(W-V)*T>=0):
    print("NO")
else:
    print("YES")

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 == 0:
    print('YES')
    break
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
c1, a = map(int, input().split(' '))
c2, b = map(int, input().split(' '))
t = int(input())

if a == b:
	print("NO")
else:
	tt = (c2 - c1) / (a - b)

	if tt%1 == 0 and tt < t and tt > 0:
		print("YES")
	else:
		print("NO")

Submission status: Wrong Answer

Solution code:
import numpy as np
#数値型を分割して取り出し
A, V = map(int, input().split())
B, W = map(int, input().split())
#数値型の取り出し
T = int(input())
AA = A
BB = B
u = np.array([i for i in range(1,T)])

ans = "NO"
for i in u:
  if BB > AA:
    AA += V
  else:
    AA -= V    
  if BB + W >= AA:
    BB += W
  else:
    BB -= W
  if AA == BB:
    ans = "YES"
    break
print(ans)

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:
    print("NO")
    exit()


if round(kyo / ti) <= 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 and v<=w:
    print("NO")
elif a>b and v>=w:
    print("NO")
elif a<b:
    if -((a-b)//(v-w))<=t:
        print("YES")
    else:
        print("NO")
else:
    if -((-a+b)//(w-v))<=t:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

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

direct_right = True
A_point = A
B_point = B
for i in range(1,T+1) :
   if direct_right : 
      if A_point+(V) == B_point+(W):
         print("YES")
         exit()
      if A_point+(V) > B_point+(W):
         direct_right = False
      A_point = A_point+(V) 
      B_point = B_point+(W)
   else: 
      if A_point-(V) == B_point-(W):
         print("YES")
         exit()
      if A_point-(V) < B_point-(W):
         print("NO")
         exit()
      A_point = A_point-(V) 
      B_point = B_point-(W)

print("NO")

Submission status: Wrong Answer

Solution code:
ABVW = [map(int, input().split()) for _ in range(2)]
AB, VW = [list(i) for i in zip(*ABVW)]
T = int(input())

if VW[0] == VW[1]:
    print("NO")
else:
    if AB[1] + VW[1]*T - (AB[0] + VW[0]*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:
    print("NO")
    exit(0)

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

if a == b:
    print("YES")
    exit(0)

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

Submission status: Wrong Answer

Solution code:
import sys

la = list(map(int, input().split()))
lb = list(map(int, input().split()))
t = int(input())

if lb[1] == 0:
    print("YES")
    sys.exit()

dis = 0
if la[0] >= 0 and lb[0] >= 0:
    dis =  abs(la[0] - lb[0])
elif la[0] <= 0 and lb[0] <= 0:
    dis =  abs(la[0] + lb[0])
else:
    dis = abs(la[0])+abs(la[0])

if la[1] - lb[1] > 0:
    if dis / (la[1] - lb[1]) <= t:
        print("YES")
        sys.exit()
print("NO")

Submission status: Wrong Answer

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

    if (v-w) > 0:
        x = abs(b-a)/(v-w)
    else:
        return 'NO'
    
    if x <= t and x*v + a == x*w + b:
        return 'YES'

    return 'NO'


print(solve())

Submission status: Wrong Answer

Solution code:
import math
import sys
a,v=(int(x) for x in input().split())
b,w=(int(x) for x in input().split())
t = int(input())

e1=pow(10, -9)
e2=pow(10, 9)

if (a<e1)or(e2<a)or(b<e1)or(e2<b)or(v<1)or(e2<v)or(w<1)or(e2<w)or(t<1)or(e2<t)or(a==b):
    sys.exit(0)

aa = a/t + v
bb = b/t + w

if (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 V>W:
    if abs(B-A)%(V-W)==0 and 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>0:
    ArriveTime = float((B-A)/(V-W))
else:
    ArriveTime = float(100000000000000)

# print(str(ArriveTime))
if T >= ArriveTime:
    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
if pase <= 0:
  print("NO")

if (pase * time) + oni >= kid:
  print("YES")

Submission status: Wrong Answer

Solution code:
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #B
    #input
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    #output
    #A < Bの時
        #V <= Wであれば、相手はひたすら逃げれば良く、この時鬼は相手を捕まえられない。
        #V > Wであれば、鬼は1秒に相手との距離をV-Wだけ詰められる。
        #B-A//V-WがTより小さいか同じ場合は鬼は相手を捕まえられる。
    #A > Bの時
        #上の議論とほぼ同じ。

    if A < B:
        if V <= W:
            print("NO")
        else:
            if (B-A)//(V-W) <= T-1:
                print("YES")
            else:
                print("NO")
    elif A > B:
        if V <= W:
            print("NO")
        else:
            if (B-A)//(V-W) <= T-1:
                print("YES")
            else:
                print("NO")

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = int(input())
e = abs(a[1]-b[1])

aa = a[0]+a[1]*c
bb = b[0]+b[1]*c
d = aa-bb
if e == 0:
  print("NO")
else:  
  if aa >= bb:
    if d % e == 0:
      print("YES")
    else:
      print("NO")
  else:
    print("NO")

Submission status: Wrong Answer

Solution code:
inputA = input()
curA = int(inputA.split()[0])
a = int(inputA.split()[1])
inputB = input()
curB = int(inputB.split()[0])
b = int(inputB.split()[1])
sec = int(input())
maxA = curA + sec * a
minA = curA - sec * a
maxB = curB + sec * b
minB = curB - sec * b

result = "NO"
if maxA < minB or maxB < minA:
    result = "NO"
max = maxA if maxA < maxB else maxB
min = minA if minA > minB else minB
for i in range(min, max + 1):
    divA = a * 2
    divB = b * 2
    if i % divA == curA and i % divB == curB:
        result = "YES"
        break
    elif i % divA == (curA + a) % divA and i % divB == (curB + b) % divB:
        result = "YES"
        break
print(result)