| The 2026 ICPC Belarus Regional Contest |
|---|
| Закончено |
Alice has $$$n$$$ tabs open in a browser. Exactly $$$k$$$ of them are active, and the remaining $$$n - k$$$ tabs are in the background. Each tab consumes RAM: an active tab consumes exactly $$$a$$$ megabytes, and a background tab consumes exactly $$$b$$$ megabytes.
Alice wants to open $$$\ell$$$ more tabs. Each new tab is active and also requires $$$a$$$ megabytes of memory. The previously existing tabs remain in their initial state.
The browser is allocated $$$m$$$ megabytes of RAM in total, and it cannot use more memory than that. Determine whether the allocated memory is enough for all $$$n + \ell$$$ tabs to stay open at the same time.
The only line contains six integers $$$n$$$, $$$k$$$, $$$a$$$, $$$b$$$, $$$\ell$$$, $$$m$$$ ($$$0 \leq k \leq n \leq 10^4$$$, $$$0 \leq a, b \leq 10^4$$$, $$$0 \leq \ell \leq 10^4$$$, $$$0 \leq m \leq 2 \cdot 10^{8}$$$).
It is guaranteed that, before opening new tabs, the allocated memory was enough to fit all the already existing tabs.
Print YES if the allocated memory is enough; otherwise, print NO. You may print the words in any case.
3 2 10 5 1 100
YES
5 5 2 100 0 10
YES
0 0 7 1 3 20
NO
4 1 10 67 5 340
YES
In the first example, Alice has $$$2$$$ active tabs consuming $$$10$$$ megabytes each, and $$$1$$$ background tab consuming $$$5$$$ megabytes. Adding $$$1$$$ more active tab raises the usage to $$$(2 + 1) \cdot 10 + 1 \cdot 5 = 35$$$ megabytes, which is less than the $$$100$$$ megabytes Alice has at her disposal.
In the second example, no new tabs are added, and the previously existing tabs consume exactly the amount of available memory.
In the third example, all tabs are new, and they do not fit into the available memory.
The fourth example is illustrated by the image above. The amount of available memory after subtracting previously opened tabs is $$$129$$$ megabytes, so Alice can comfortably open $$$5$$$ new tabs, but, for example, opening $$$13$$$ new tabs would require Alice to close a few older tabs.
| Название |
|---|


