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:
N,S = map(int,input().split())
n,s = map(int,input().split())
T = int(input())

ans1 = N + S*T
ans2 = n + s*T

if n < N:
  print("NO")
elif ans1 >= ans2:
  print("YES")
else:
  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 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:
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:
import math
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

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

if abs(a) > abs(b):
    mostabs = abs(a)
else:
    mostabs = abs(b) + 10 # +10は適当な数字(aかbaが<0でabs(a)==abs(b)ならあとでmostabsをa, bに加える時0が発生してしまうため)

if a < 0 or b < 0:
    a += mostabs
    b += mostabs

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

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

if v > w:
    if t >= requiredtime:
        print("YES")
    else:
        print("NO")
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())
T0 = 0
L = abs(A - B)

if W >= V:
  print('NO')
elif L % (V - W) != 0:
  print('NO')
else:
  if L // (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 = input()

a = int(A) #+ (int(V) * int(T))
b = int(B) #+ (int(W) * int(T))

count = int(T)
for i in range(1, count + 1, 1):
    a += int(V)
    b += int(W)

    if a == b:
        print("YES")
        break

if (a != b):
    print("NO")

Submission status: Wrong Answer

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

@author: sd18016
"""

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

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

Submission status: Wrong Answer

Solution code:
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 1<=atai<=t and a+v*t>=b+w*t:
    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:
    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:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())


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

print('NO')

Submission status: Wrong Answer

Solution code:
# import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()
A,V = list(map(int, input().split())) # 1行, 配列
B,W = list(map(int, input().split())) # 1行, 配列
T = int(input()) # 1行, 単数
ans = 'NO'

for i in range(1,T+1):
  if A + V*i == B + W*i:
    ans = 'YES'
    break

print(ans)

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 = (B-A)/(V-W)
        if t <= T and is_integer(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] = list(map(int, input().split()))
[b,w] = list(map(int, input().split()))
t = int(input())
nomi = a-b
denomi = w-v
if denomi != 0:
    rem = nomi % denomi
    if rem == 0:
        tRe = nomi//denomi
        if 0<=tRe<=t:
            print('YES')
        else:
            print('NO')
    else:
        tRe = nomi / denomi
        if 0 < tRe < t:
            print('YES')
        else:
            print('NO')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import sys

n = list(map(int,input().split()))
r = list(map(int,input().split()))
t = int(input())

A = n[0]
V = n[1]

B = r[0]
W = r[1]

T = t

after_a = A + V * T
after_b = B + W * T

if after_a == after_b:
    print('YES')
    sys.exit()

elif A < B and after_a > after_b:
    target = ['YES' if (A + V * i) - (B + W * i) == 0  else 'NO' for i in range(T)]
    print(target)

elif A > B and after_a < after_b:
    target = ['YES' if (A + V * i) - (B + W * i) == 0  else 'NO' for i in range(T)]
    print(target)
else:
    print('NO')

Submission status: Wrong Answer

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

if v <= w:
  print("NO")
elif abs(b-a)/(w-v) > t:
  print("NO")
else:
  print("YES")

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-3)) == 0:
        break
    elif T//(2**i) == 0:
        if a > b:
            mid = mid - 1
            if mid < 1:
                mid = 1
        elif a < b:
            mid = mid + 1
            if mid > T:
                mid = T
    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()

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

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

max_dis = t*catchup_speed

if start_dis <= max_dis:
    print('YES')
    exit()

print('YES')

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 + v*t
bb = b + w*t

if (aa>=bb):
    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())

for num in range(T):
    C=A+V*num
    D=B+W*num
    if C == D:
        print('YES')
        break
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 w >= v:
    print('NO')
    sys.exit()

x = v - w
y = abs(a - b)
#print(y)

if y % x == 0 and y // x <= t:
    if (-1000000000 <= (v * (y // x) + a) <= 1000000000) or (-1000000000 <= (-1 * v * (y // x) + a) <= 1000000000):
        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)
  # 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 = False
    else:
      ans = True  
  elif a < b:
    if a_can_plus < b_can_plus:
      ans = False
    else:
      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())

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

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

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:
    if w-v<v:
        if b>a:
            if a > 0:
                if (10**9-a)/v < t-1:
                    print('YES')
                else:
                    print('NO')
            else:
                if (10**9+abs(a))/v < t-1:
                    print('YES')
                else:
                    print('NO')
        else:
            if a>0:
                if (10**9+a)/v < t-1:
                    print('YES')
                else:
                    print('NO')
            else:
                if (abs(a))/v < t-1:
                    print('YES')
                else:
                    print('NO')
elif (b-a)/(v-w) < t:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a = [input() for i in range(3)]
b = list(map(float,a[0].split()))
c = list(map(float,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,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:
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
  if (v - w) * t > abs(a - b):
    ans = True
  elif a > b:
    if b_can_minus < a_can_minus:
      ans = False
    else:
      ans = True  
  elif a < b:
    if a_can_plus < b_can_plus:
      ans = False
    else:
      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())

iter = False
#while iter == False:
if a < b:
  for s in range(t+1):
    res = a + s*v - (b+s*w)
    if res == 0:
      iter = True
      break
elif a > b:
  for m in range(t+1):
    res = a - m*v - (b - m*w)
    if res == 0:
      iter = True
else:
  iter = True
  



if iter == 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())
ans = 0

for i in range(T):
    A += V
    B += W
    if(A == B):
        ans = 1
        break
    else:
        ans = 2
        
if(ans == 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())
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)
            break

    #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 v < w:
    print("NO")
    exit(0)

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

Submission status: Wrong Answer

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

ans1 = N + S*T
ans2 = n + s*T

if S - s <= 0 or n < N:
  print("NO")
elif ans1 >= ans2 and (n-N) % (S-s) == 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:
     if deltaV==0:
        return 'NO'
     elif T> deltaD//deltaV:
        return 'YES'
  return 'NO'
    
print(check())

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 V>W and (A-B)%(V-W)==0:
    Flag = True

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

position_diff = b - a
pace_diff = v - w

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

Submission status: Wrong Answer

Solution code:
oni = list(map(int,input().split()))
child =list(map(int,input().split()))
time = int(input())
oni_kyori = oni[0]+oni[1]*time
child_kyori = child[0]+child[1]*time

if oni[0]<child[0]:
    if oni_kyori<child_kyori:
        print('NO')
    else:
        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
        else:
            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,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 (b-a)%(v-w)==0 and (b-a)//(v-w)<=t:
        if (b-a)%(v+w)==0:
            print("YES")
        else:
            print("NO")
    else:
        print("NO")
else:
    if (a-b)%(w-v)==0 and (a-b)//(w-v)<=t:
        if (a-b)%(v+w)==0:
            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())

for i in range(1, T+1):
    if A < B:
        A = A + V
        B = B + W
    elif A > B:
        A = A - V
        B = B - W
    elif A == B:
        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())

for i in range(T):
    if abs((V-W)*i) == abs((B-A)):
        print('YES')
        break

else:
    print('NO')

Submission status: Wrong Answer

Solution code:
def tag(a,b,v,w,t):
    if w>=v:
        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:
import sys

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, 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 int(kyo / ti) <= t:
    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)

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

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

if 0 <= ((B - A) / (V - W)) <= 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-3)) == 0:
        break
    elif T//(2**i) == 0:
        if a > b:
            mid = mid - 1
            if mid < 0:
                mid = 0
        elif a < b:
            mid = mid + 1
            if mid > T:
                mid = T
    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=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
v=V-W
l=B-A
if l==0:
  print('YES')
elif l>0:
  if l <= v*T:
    print("YES")
  else:
    print("NO")
else:
  if l >= 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 v <= w and a < b:
  print('NO')
  exit()
  
oni = a + (v*t)
child = b + (w*t)

if oni >= child:
  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())

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;

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

Submission status: Wrong Answer

Solution code:
oni = list(map(int,input().split()))
child =list(map(int,input().split()))
time = int(input())
oni_kyori = oni[0]+oni[1]*time
child_kyori = child[0]+child[1]*time

if oni[0]<child[0]:
    if oni_kyori<child_kyori:
        print('NO')
    else:
        print('YES')
else:
    if oni_kyori>child_kyori:
        print('NO')
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
from sys import stdin
input = stdin.readline
 
A,V = input().rstrip().split()
B,W = input().rstrip().split()
T = int(input().rstrip())
A,V,B,W = int(A),int(V),int(B),int(W)
s=0
for t in range(T):
  if B<A:
    A-=V
    B-=W
    if B>=A:
      print('Yes')
      s=1
      break
  else:
    A+=V
    B+=W
    if B<=A:
      print('Yes')
      s=1
      break
 
if s!=1:
  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'
if w >= v:
  pass
else:
  for i in range(t+1):
    print(i)
    if a + v * t >= b + w * t:
      ans='YES'
      break
print(ans)

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

if abs(V-W)*T >= A-B:
  print("YES")
else:
  print("NO")
#

Submission status: Wrong Answer

Solution code:
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

from decimal import Decimal
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if a == b:
    print("YES")
elif v <= w:
    print("NO")
else:
    if Decimal((b-a)/(v-w)) == math.floor(Decimal((b-a)/(v-w))) and abs( Decimal((b-a)/(v-w))) <= t:
        print("YES")
    else:
        now_a = a
        now_b = b
        if a < b:
            for i in range(1, t+1):
                now_a += v
                now_b += w
                if a < b:
                    pass
                else:
                    if Decimal((now_b-now_a)/(v-w)) == math.floor(Decimal((now_b-now_a)/(v-w))) and abs(Decimal((now_b-now_a)/(v-w))) <= t-i:
                        print("YES")
                        exit()
                    else:
                        print("NO")
                        exit()
        else:
            for i in range(1, t+1):
                now_a -= v
                now_b -= w
                if a > b:
                    pass
                else:
                    if Decimal((now_b-now_a)/(v-w)) == math.floor(Decimal((now_b-now_a)/(v-w))) and abs(Decimal((now_b-now_a)/(v-w))) <= t-i:
                        print("YES")
                        exit()
                    else:
                        print("NO")
                        exit()

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==0 and a_v-b_v == 0:
  flag = 1
elif a-b==0 or a_v-b_v == 0:
  flag = 0
else:
  t_set = (a-b)/(b_v - a_v)
  t_int = int(t_set)
  if t_set>0:
    if t_int == t_set:
      if 0<t_set and t_set<=t:
        flag = 1
      else:
        flag = 0
    else:
      flag = 0

if flag == 0:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

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

if(int(AV[0]) > int(BW[0])):
  T *= -1

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

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

Submission status: Wrong Answer

Solution code:
import sys

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

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

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

while True:
    t, distance = divmod(distance, diff)
    if t > T:
        print("NO")
        break
    if distance == 0:
        print("YES")
        break

    distance = abs(distance - V - W)
    T -= t

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) or (A % 2 == B % 2 and V % 2 != W % 2):
  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) < 1 or (B-A) > (V-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())

if A == B and V != W:
    print('NO')
    exit()
if V == W:
    print('NO')
    exit()

if 0 <= ((B - A) / (V - W)) <= T:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
line = input().split()
line2 = input().split()
lim = int(input())

apos = int(line[0])
aspeed = int(line[1])
bpos = int(line2[0])
bspeed = int(line2[1])

distance = abs(bpos - apos)
deltaspeed = aspeed - bspeed
if deltaspeed == 0:
  print("NO")
if deltaspeed !=0:
  time = distance/deltaspeed
  if time <= lim:
    print("YES")
  else:
    print("NO")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
a,v =map(int, input().split())
b,w =map(int, input().split())
t=int(input())
count=0

for i in range(1,t+1) :
    a += v
    b += w 
    if a == b :
        print("YES")
        count+=1
        break;

if count ==0 :
    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 t <= abs(a - b)/abs(v - w):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
a,v = map(int,input().split())
b,u = map(int,input().split())
t = int(input())
if v >= u:
  print('NO')
  quit()
dis = (u-v) * t
f = abs(a-b)
if f <= dis:
  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())

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

Submission status: Wrong Answer

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

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

    return 'NO'


print(solve())

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):
    A += V
    B += W
    if(A == B):
        print('YES')
        break
    elif(i == T - 1):
        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')

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 = 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:
            AT = A
            BT = B
            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)