305553: CF1054A. Elevator or Stairs?
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Elevator or Stairs?
题意翻译
Masha要从$x$楼到$y$楼找Egor($x \neq y$)。她可以走楼梯或坐电梯。在相邻(数字差$1$)两层之间,走楼梯要$t_1$时间,坐电梯要$t_2$时间。电梯停楼层要$t_3$时间。现在电梯在$z$楼。如果从$x$楼到$y$楼坐电梯不比走楼梯慢,那么输出`YES`;否则输出`NO`。题目描述
Masha lives in a multi-storey building, where floors are numbered with positive integers. Two floors are called adjacent if their numbers differ by one. Masha decided to visit Egor. Masha lives on the floor $ x $ , Egor on the floor $ y $ (not on the same floor with Masha). The house has a staircase and an elevator. If Masha uses the stairs, it takes $ t_1 $ seconds for her to walk between adjacent floors (in each direction). The elevator passes between adjacent floors (in each way) in $ t_2 $ seconds. The elevator moves with doors closed. The elevator spends $ t_3 $ seconds to open or close the doors. We can assume that time is not spent on any action except moving between adjacent floors and waiting for the doors to open or close. If Masha uses the elevator, it immediately goes directly to the desired floor. Coming out of the apartment on her floor, Masha noticed that the elevator is now on the floor $ z $ and has closed doors. Now she has to choose whether to use the stairs or use the elevator. If the time that Masha needs to get to the Egor's floor by the stairs is strictly less than the time it will take her using the elevator, then she will use the stairs, otherwise she will choose the elevator. Help Mary to understand whether to use the elevator or the stairs.输入输出格式
输入格式
The only line contains six integers $ x $ , $ y $ , $ z $ , $ t_1 $ , $ t_2 $ , $ t_3 $ ( $ 1 \leq x, y, z, t_1, t_2, t_3 \leq 1000 $ ) — the floor Masha is at, the floor Masha wants to get to, the floor the elevator is located on, the time it takes Masha to pass between two floors by stairs, the time it takes the elevator to pass between two floors and the time it takes for the elevator to close or open the doors. It is guaranteed that $ x \ne y $ .
输出格式
If the time it will take to use the elevator is not greater than the time it will take to use the stairs, print «YES» (without quotes), otherwise print «NO> (without quotes). You can print each letter in any case (upper or lower).
输入输出样例
输入样例 #1
5 1 4 4 2 1
输出样例 #1
YES
输入样例 #2
1 6 6 2 1 1
输出样例 #2
NO
输入样例 #3
4 1 7 4 1 2
输出样例 #3
YES