308065: CF1461E. Water Level
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Water Level
题意翻译
饮水机中本来有 $k$ 升水,John希望在 $t$ 天内饮水机的水量在 $[l,r]$ 之间,John知道每一天饮水机会被用掉正好 $x$ 升水,而John可以在一天的开始选择加正好 $y$ 升水(一天只能加一次)或不加水. 给出 $k,l,r,t,x,y$. 求能否在 $t$ 天内把水量控制在 $[l,r]$.能输出 `Yes` ,否则输出 `No`. 保证数据范围有: $1\leq l\leq k\leq r\leq 10^{18},1\leq t\leq10^{18},1\leq x\leq10^6,1\leq y\leq10^{18}.$题目描述
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1461E/7f311014452a10e23ecd60bd4752a8b017b50a00.png)Originally the cooler contained exactly $ k $ liters of water. John decided that the amount of water must always be at least $ l $ liters of water but no more than $ r $ liters. John will stay at the office for exactly $ t $ days. He knows that each day exactly $ x $ liters of water will be used by his colleagues. At the beginning of each day he can add exactly $ y $ liters of water to the cooler, but at any point in time the amount of water in the cooler must be in the range $ [l, r] $ . Now John wants to find out whether he will be able to maintain the water level at the necessary level for $ t $ days. Help him answer this question!输入输出格式
输入格式
The first line of the input contains six integers $ k $ , $ l $ , $ r $ , $ t $ , $ x $ and $ y $ ( $ 1 \le l \le k \le r \le 10^{18}; 1 \le t \le 10^{18}; 1 \le x \le 10^6; 1 \le y \le 10^{18} $ ) — initial water level, the required range, the number of days, daily water usage and the exact amount of water that can be added, respectively.
输出格式
Print "Yes" if John can maintain the water level for $ t $ days and "No" otherwise.
输入输出样例
输入样例 #1
8 1 10 2 6 4
输出样例 #1
No
输入样例 #2
8 1 10 2 6 5
输出样例 #2
Yes
输入样例 #3
9 1 10 9 2 9
输出样例 #3
No
输入样例 #4
20 15 25 3 5 7
输出样例 #4
Yes