Correct answer will be upvoted else Multiple Downvoted. Computer science. Originally the cooler contained exactly k liters of water. John concluded that the amount of water should always be at least l liters of water yet close to r liters. John will stay at the workplace for exactly t days. He realizes that each day exactly x liters of water will be utilized by his colleagues. At the start of each day he can add exactly y liters of water to the cooler, however at any point in time the amount of water in the cooler should be in the range [l,r]. Presently John wants to see if he will actually want to maintain the water level at the necessary level for t days. Assist him with answering this inquiry! Input The principal line of the input contains six integers k, l, r, t, x and y (1≤l≤k≤r≤1018;1≤t≤1018;1≤x≤106;1≤y≤1018) — initial water level, the necessary range, the number of days, daily water usage and the exact amount of water that can be added, individually. Output Print "Yes" if John can maintain the water level for t days and "No" in any case
Correct answer will be upvoted else Multiple Downvoted. Computer science.
Originally the cooler contained exactly k liters of water. John concluded that the amount of water should always be at least l liters of water yet close to r liters. John will stay at the workplace for exactly t days. He realizes that each day exactly x liters of water will be utilized by his colleagues. At the start of each day he can add exactly y liters of water to the cooler, however at any point in time the amount of water in the cooler should be in the range [l,r].
Presently John wants to see if he will actually want to maintain the water level at the necessary level for t days. Assist him with answering this inquiry!
Input
The principal line of the input contains six integers k, l, r, t, x and y (1≤l≤k≤r≤1018;1≤t≤1018;1≤x≤106;1≤y≤1018) — initial water level, the necessary range, the number of days, daily water usage and the exact amount of water that can be added, individually.
Output
Print "Yes" if John can maintain the water level for t days and "No" in any case
Step by step
Solved in 2 steps with 2 images