Priceless sandwich
Limits: 1 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Zenyk is a poor student, so he monitors his expenses. Currently, he has \(s\) hryvnias. He knows that on the promotion day he will be able to buy one piece (such is the life of a poor student) of cheese for \(a\) hryvnias. He also knows how much a piece of sausage and bread costs — \(b\) and \(c\) hryvnias respectively.
To avoid starving, Zenyk needs just one sandwich per day. The special recipe for his sandwich must contain one piece of bread, one piece of cheese, and two pieces of sausage. Can you calculate the maximum number of days he can avoid starving with his \(s\) hryvnias?
Input
The single line contains four integers \(s\), \(a\), \(b\), \(c\) — the amount of hryvnias Zenyk has and the prices for cheese, sausage, and bread respectively.
Output
In the single line print one integer — the number of days Zenyk will not starve, i.e., the number of sandwiches he can make considering his budget.
Constraints
\(1 \le s, a, b, c \le 10^5\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 12 2 1 1 | 2 |
Notes
Note that the number of sandwiches Zenyk eats can be equal to zero.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|