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: Runtime Error

Solution code:
a_index, a_v = map(int, input().split())
b_index, b_v = map(int, input().split())
t = input()
 
d = abs(b_index - a_index)
d_v = abs(w - v)
t_at = d / a_v
 
if (t_at < t) :
  print("YES")
else :
  print("NO")

Submission status: Runtime Error

Solution code:
[a_index, a_v] = map(int, input().split())
[b_index, b_v] = map(int, input().split())
t = input()

d = abs(b_index - a_index)
d_v = abs(w - v)
t_at = d / a_v

if (t_at < t) :
  print("YES")
else :
  print("NO")

Submission status: Runtime Error

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

D = abs(A - B)
X = abs(V - W)

if (X*T >= D):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
diff_dist = B - A
diff_v = V - W
flag = False
if diff_dist == 0:
    flag = True
else:
    if diff_dist > 0:
        if diff_v > 0:
            t = diff_dist / diff_v
            if t <= T:
                flag = True
        else:
            flag = False
    else:
        if diff_v < 0:
            t = diff_dist / diff_v
            if t <= T:
                flag = True
        else:
            flag = Flase
if flag:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

D = abs(A - B)
X = abs(x - Y)

if (X*T >= D):
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

D = abs(A - B)
X = abs(x - Y)

if X*T >= D:
  print("OK")
else:
  print("NG")

Submission status: Runtime Error

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if abs(b-a) - (v-w)*t <= 0:
    print("YES")
ekes:
    print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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"))
between = abs(b - a)
speed = w - v
if between <= speed*t
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
d=abs(a-b)
md=abs(v-w)
if d%md==0:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
A, V = map(int,input(),split())
B, W = map(int,input(),split())
T = input()
if (V <= W):
    print("NO")
elif(T < abs(A - B)/(V-W)):
    print("NO")
else:
    print("YES")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
stdin = [input() for i in range(3)]
line = stdin[0].split(' ')
A = int(line[0])
V = int(line[1])
line = stdin[1].split(' ')
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
length = 0
if B < A:
    length = B-A
else:
    length = A-B
else:
    if (V-W)*T < length:
        print('NO')
    else:
        print('YES')

Submission status: Runtime Error

Solution code:
stdin = [input() for i in range(3)]
line = stdin[0]
A = int(line[0])
V = int(line[1])
line = stdin[1]
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
if (V-W)*T < B-A:
    print('NO')
else:
    print('YES')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


if V-W <= 0
    print("No")
else:
    if dis - T*mob <= 0:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
import sys
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if v<=w:
    print('NO')
    sys.exit()
else:
    d=abs(a-b)
    s=v-w
    if d<=ts:
        print('YES')
        sys.exit()
print('NO')

Submission status: Runtime Error

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

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

s = V - W
if D < s * T:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

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

s = V - W
if D < s * T:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

print('YES' if V > W and abs(A - B) <= T * (V - W) else 'NO')

Submission status: Runtime Error

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

if v > w:
    # 1秒あたり距離はv-wだけ縮まる
    # t秒の時の距離は(v-w)*t
    # それが|a-b| の距離に間に合うor追い越せるかどうか
    if abs(a - b) <= (v - w) * t
    # if t <= abs(a - b):
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import math
A,V = int(input().split())
B,W = int(input().split())
T = int(input())

dis=abs(A-B)
dis1=(V-W)*T
if dis<=dis1:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
A,V = int(input().split())
B,W = int(input().split())
T = int(input())

dis=abs(A-B)
dis1=(V-W)*T
if dis<=dis1:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
A,V = int(input().split())
B,W = int(input().split())
T = int(input())

dis=abs(A-B)
dis1=(V-W)*T
if dis<=dis1:
    print("YES")
else:print("NO")

Submission status: Runtime Error

Solution code:
N, K= map(int,input().split())
A = list(map(int,input().split()))
p=0
while p<K:
  B=[0]*N
  for i in range(N):
    count = 0
    for j in range(N):
      if A[j]+1>abs(j-i):
        count +=1
    B[i] = count
  if min(A)==N:
    break
  A = B
  p +=1
print(*A)

Submission status: Runtime Error

Solution code:
a, v=map(int, input().split())
b, w=map(int, input().split())
t=int(input())
 
dis =abs(a-b)
mob =v-w
 
if speed<=0:
    print("No")
else:
    if distance/speed <=t:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
a, v=map(int, input().split())
b, w=map(int, input().split())
t=int(input())
 
dis =abs(a-b)
mob =v-w
 
if speed<=0:
    print("No")
else:
    if distance/speed <=T:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if (A-B)//(V-W) <= T:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

l  = abs(a-b)

if (v - w) * t >= l:
    Print("YES")
else:
    Print("NO")

Submission status: Runtime Error

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

dis = abs(a-b)
sub = w-v

if(-(sub*t)>=dis):
    print("YES")
else:

Submission status: Runtime Error

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

if w >= v:
    print('NO')
else:
    kyori = abs(a-b)
    time = kyori - (v-w)
    if t >= kyori/time:
        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

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

if w >= v:
    print('No')
else:
    kyori = abs(a-b)
    time = kyori - (v-w)
    if t >= kyori/time:
        print('YES')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
 
M = max(a,b)  
m = min(a,b)  
  
if (v-w)*t > M - n:
	print('YES')
else:
	print('NO')

Submission status: Runtime Error

Solution code:
x1, v1 = map(int, input().split(' '))
x2, v2 = map(int, input().split(' '))
t = int(input())

if v1 == v2:
	print("NO")
else:
	s = abs(x2 - x1) / (v1 - v2)
	if s <= T:
		print("NO")
	else:
		print("YES")

Submission status: Runtime Error

Solution code:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
 
M = max(a,b)  
m = min(a,b)  
  
if (v-w)*t > M - n:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x1, v1 = map(int, input().split(' '))
x2, v2 = map(int, input().split(' '))
t = int(input())

if v1 == v2:
	print("NO")
else:
	s = abs(x2 - x1) / (v1 - v2)
	if s <= T:
		print("YES")
	else:
		print("NO")

Submission status: Runtime Error

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

d = abs(b-a)
p = v-w
i=0
for i in range(t+1):
  if v<=w:
    print('NO')
  elif p*i == d:
    print('YES')
    
  else:
    print('NO')

Submission status: Runtime Error

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

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

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

print(caught)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if v <= w:
    print('NO')
else:
    elif 1 <= ((b - a) / (v - w)) <= t:
        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

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

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

# import math
# if abs(B-A)/(V-W) <= T:
#     print("YES")
# else:
#     print("NO")

# 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: Runtime Error

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

a_st = 0
a_ed = 0
if a < a_v*t:
  a_st = a
  a_ed = a+a_v*t
else:
  a_st = a+a_v*t
  a_ed = a

b_st = 0
b_ed = 0
if b < b_v*t:
  b_st = b
  b_ed = b+b_v*t
else:
  b_st = b+b_v*t
  b_ed = b

v=a_v-b_v
if (a_st-b_st)%v == 0 or (a_ed-b_ed)%v==0 or (a_st-b_ed)%v==0 or (b_st-a_ed):
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if v <= w:
    print('NO')
else:
    elif 1 <= ((b - a) / (v - w)) <= t:

        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,V = (int(x) for x in input().split())
B,W = (int(x) for xin input().split())
T = int(input())

if V>W and abs(A-B)/(V-W)<=T:
    Flag = True
else:
    Flag = False
    
if Flag:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

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

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

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

Submission status: Runtime Error

Solution code:
import sys

A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if V <= W:
  print('NO')
  sys.exit()
if 0 < abs((B-A)//(V-W)) <= T:
  print('YES')import sys

A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if V <= W:
  print('NO')
  sys.exit()
t= abs(B-A)%(V-W)
if 0 < abs((B-A)//(V-W)) <= T:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long a, b, v, w, t;
    cin >> a >> v;
    cin >> b >> w;
    cin >> t;
    if (a >= b)
    {
        cout << "NO\n";
        return 0;
    }
    long long temp1 = a + t * v;
    long long temp2 = b + t * w;
    if (temp1 >= temp2)
    {
        cout << "YES\n";
    }
    else
    {
        /* code */
        cout << "NO\n";
    }
    return 0;
}

Submission status: Runtime Error

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)

a = abs(a)
b = abs(b)

if a > b:
    w = a
    a = b
    b = a

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

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

if v > w:
    if t >= requiredtime:
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
A,V = (int(x) for x in input().split())
B,W = (int(x) for x in input().split())
T = int(input())
if V>W:
    if (A-B)%(V-W)==0:
        if abs(A-B)//(V-W)<=T:
            Flag = 1
    else:
        if abs(A-B)//(V-W)+1<=T:
            Flag = 1
else:
    Flag = False
    
if Flag:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if b - a > 0:
    b_f = min(b+t*w, 10 ** 9)
    a_f = min(a+t*v, 10 ** 9)
    if b_f > a_f:
        print("NO")
    else:
        print("YES")


else:
    b_f = max(b-t*w, -10 ** 9)
    a_f = max(a-t*v, -10 ** 9)
    if b_f < a_f:
        print("NO")
    else:
        print("YES")

Submission status: Runtime Error

Solution code:
P = []
S = []
for i in range(2):
    pp, ss  = map(int, input().split())
    P.append(pp)
    S.append(ss)

A = P[0]
V = S[0]
B = P[1]
W = S[1]
T = int(input())

def run():
	if A < B:
		c = (B + W*T) - (A + V*T)
		if c <= 0 :
			return 'YES'
		else :
			return 'NO'
	elif A > B:
		c =  (A - V*T) - (B - W*T)
		if c <= 0 :
			return 'YES'
		else :
			return 'NO'
    else :
        return 'YES'
print(run())

Submission status: Runtime Error

Solution code:
import sys

inputs = [input() for i in range(3)]
oni = list(map(int, inputs[0].split()))
kid = list(map(int, inputs[1].split()))
time = int(inputs[2])

if (oni[0] > kid[0] && oni[1] > kid[1]) || (oni[0] < kid[0] && oni[1] < kid[1]):
  print("NO")
  return

for i in range(time):
  point_A = oni[0] + oni[1] ** i
  point_B = kid[0] + kid[1] ** i
  if point_A == point_B:
    print("YES")
    return

print("NO")
return

Submission status: Runtime Error

Solution code:
A,V = (int(x) for x in input().split())
B,W = (int(x) for x in input().split())
T = int(input())
if V>W:
    if (A-B)%(V-W)==0:
        if abs(A-B)//(V-W)<=T:
            Flag = 1
    else:
        if abs(A-B)/(V-W)+1<=T:
            Flag = 1
else:
    Flag = False
    
if Flag:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
inputA = input()
inputB = input()
secIn = input()
sec = int(secIn)
splitA = inputA.split()
splitB = inputB.split()
curA = int(splitA[0])
a = int(splitA[1])
curB = int(splitB[0])
b = int(splitB[1])

dis = curA - curB if curA > curB else curB > curA

result = "NO"
v = a - b
if v <= 0:
    result = "NO"
elif dis % v != 0:
    result = "NO"
elif di / v > sec:
    result = "NO"
else:
    result = "YES"

print(result)

Submission status: Runtime Error

Solution code:
a = int(input('A '))
b = int(input('B '))
c = int(input('V '))
d = int(input('W '))
e = int(input('T '))

x = a-b
y = abs(x)
z = c*e-d*e

if z >= y:
    print('YES')
    
else:
    pritn('NO')

Submission status: Runtime Error

Solution code:
x=input().split()
a=int(x[0])
v=int(x[1])
y=input().split()
b=int(y[0])
w=int(y[1])
t=int(input())
if b>a:
  	if w>v:
    	print("NO")
	else:
      da=v*t
      db=w*t
      fa=da+a
      fb=b+db
		if fa>=fb:
    		print("YES")
		else:
    		print("NO")
else:
   	da=v*t
	db=w*t
	fa=a-da
	fb=b-db
    if fa>=0 and fb<0:
      print("NO")
    elif fa<=0 and fb>=0:
      print("YES")
    else:
		if fa<=fb:
    		print("YES")
		else:
    		print("NO")

Submission status: Runtime Error

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: Runtime Error

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

distance=abs(a-b)
speed=w-v

ans=0

if distance%speed==0:
    if distance/speed<=t:
        print("YES")
        ans+=1

if ans==0:
    print("NO")

Submission status: Runtime Error

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

distance=abs(a-b)
speed=w-v

ans=0

if distance%speed==0:
    if distance%speed<=t:
        print("YES")
        ans+=1

if ans==0:
    print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A = A-B
B = 0

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

Submission status: Runtime Error

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

aa = a[0]+a[1]*c
bb = b[0]+b[1]*c
d = aa-bb
e = a[1]-b[1]

if aa > bb:
  if d % e == 0:
    print("YES")
  else:
    print("NO")
elif aa = bb:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

cnt=0

def solve(a,b):
    global cnt,t
    cnt+=1
    if cnt>t:
        print("NO")
        return
    
    if b>a:
        if b+w==a+v:
            print("YES")
            return
        else:
            solve(a+v,b+w);
        
    else:
        if b-w==a-v:
            print("YES")
            return
        else:
            solve(a-v,b-w)

    return

if v<=w:
    print("NO")
else:
    solve(a,b)

Submission status: Runtime Error

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

aa = a[0]+a[1]*c
bb = b[0]+b[1]*c
d = aa-bb
e = a[1]-b[1]

if aa > bb:
  if d % e == 0:
    print("YES")
  else:
    print("NO")
elif aa == bb:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

aa = a[0]+a[1]*c
bb = b[0]+b[1]*c
d = aa-bb
e = a[1]-b[1]

if aa >= bb:
  if d % e == 0:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
inputA = input()
inputB = input()
secIn = input()
sec = int(secIn)
splitA = inputA.split()
splitB = inputB.split()
curA = int(splitA[0])
a = int(splitA[1])
curB = int(splitB[0])
b = int(splitB[1])
if sec % 2 == 0:
    evenSec = sec
    oddSec = sec -1
else:
    evenSec = sec -1
    oddSec = sec

maxAOdd = curA + oddSec * a
maxAEven =  curA + evenSec * a
minAOdd = curA - oddSec * a
minAEven = curA - evenSec * a
maxBOdd = curB + oddSec * b
maxBEven =  curB + evenSec * b
minBOdd = curB - oddSec * b
minBEven = curB - evenSec * b
    
aEvenSet = set(list(range(minAEven, maxAEven + 1, 2 * a)))
aOddSet = set(list(range(minAOdd, maxAOdd + 1, 2 * a )))
bEvenSet = set(list(range(minBEven, maxBEven + 1, 2 * b)))
bOddSet = set(list(range(minBOdd, maxBOdd + 1, 2 * b )))
interOddSet = aOddSet.intersection(bOddSet)
interEvenSet = aEvenSet.intersection(bEvenSet)

result = "NO"
if len(interEvenSet) > 0:
    result = "YES"
elif len(interOddSet) > 0:
    result = "YES"
else:
    result = "NO"

print(result)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

D = float(abs(A-B))
E = float(V - W)
time = int(D/E)

if E <= 0:
	print("NO")
elif time <= T:
	print("YES")
else:
	print("NO")

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

d = abs(b-a)
p = v-w
i=0
for i in range(t+1):
  if v<=w:
    print("NO")
  elif p*i == d:
    print("YES")
    
  elif p*i < d:
    print("NO")

Submission status: Runtime Error

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

cnt=0

def solve(a,b):
    global cnt,t
    cnt+=1
    if cnt>t:
        print("NO")
        sys.exit()
    
    if b>a:
        if b+w==a+v:
            print("YES")
            sys.exit()
        else:
            solve(a+v,b+w);
        
    else:
        if b-w==a-v:
            print("YES")
            sys.exit()
        else:
            solve(a-v,b-w)

    return

if v<=w:
    print("NO")
else:
    solve(a,b)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
def main():
    A, V = map(int,input().split())
    B, W = map(int,input().split())
    T = int(input())
    if A < B and A+V*T+V => B+W*T+W:
        return('YES')
    else:
        return('NO')

Submission status: Runtime Error

Solution code:
a,w=map(int,input().split())
b,y=map(int,input().split())
n=int(input())
if w=y:
  print(”NO")
else:
  print("YES") if abs(a-b)/(w-y)<=n else print("NO")

Submission status: Runtime Error

Solution code:
ax, at = map(int, input().split(' '))
bx, bt = map(int, input().split(' '))
t = int(input())
 
a_l = ax + at*t
b_l = bx + bt*t
 
if a_l < b_l and a == b:
	print("NO")
else:
	print("YES")

Submission status: Runtime Error

Solution code:
import math

def a():
    s = input()
    print(s[:3])


def b():
    a, v = map(int, input().split())
    b, w = map(int, input().split())
    t = int(input())
    if v > w:
        if abs(a-b) / (v -w) <= t
            print('YES')
        else:
            print('NO')
    else:
        print('NO')


def c():
    print('')



def d():
    print('')


b()

Submission status: Runtime Error

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

d = abs(b-a)
p = abs(v-w)
i=0
for i in range(t+1):
  if v<=w:
    print("NO")
  elif p*i == d:
    print("YES")
    
  elif p*i < d:
    print("NO")

Submission status: Runtime Error

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

D = float(abs(A-B))
E = float(V - W)
time = D/E

if E <= 0:
	print("NO")
else:
	if time <= T:
		print("YES")
	else:
		print("NO")

Submission status: Runtime Error

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

cnt=0

def solve(a,b):
    global cnt,t
    cnt+=1
    if cnt>t:
        print("NO")
        sys.exit()
    
    if b>a:
        if b+w==a+v:
            print("YES")
            sys.exit()
        else:
            solve(a+v,b+w);
        
    else:
        if b-w==a-v:
            print("YES")
            sys.exit()
        else:
            solve(a+v,b+w)

    return

if v<=w:
    print("NO")
else:
    solve(a,b)

Submission status: Runtime Error

Solution code:
// Online C++ compiler to run C++ online.
// Write C++ code in this online editor and run it.

#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
    long long int a,v,b,w,t,diff;
    cin>>a>>v;
    cin>>b>>w;
    cin>>t;
    a = abs(a);
    b = abs(b);
    diff = abs(a-b);
    a = v*t;
    b = (w*t)+(diff);
    if(a >= b)
        cout<<"YES";
    else
        cout<<"NO";
    return 0;
}

Submission status: Runtime Error

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:
  if l <= v*T:
    if l%v==0:
      print("YES")
    else:
      print("NO")
  else:
    print("NO")
else:
  if l <= v*T:
    if l%v==0:
      print("YES")
    else:
      print("NO")
  else:
    print("NO")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A,V = (int(x) for x in input().split())
B,W = (int(x) for x in input().split())
T = int(input())
if V>W and (A-B)%(V-W)==0 and abs(A-B)//(V-M)<=T:
    Flag = True
else:
    Flag = False
    
if Flag:
    print('YES')
else:
    print('NO')