32. Dark
Jonas from the Netflix Series Dark landed in the year 2053, with the help of time
travel.
It was too hot in 2053 and he was feeling very thirsty, so he went to the nearby shop
to have some mango juice. Here he found a new system altogether to buy mango
juice. In 2053, you can buy 1 liter juice in tetra prisma pack for x dollars, 1 liter juice in
cans for y dollars and if you want, you can return back empty cans to the shopkeeper
which he can recycle, and in that case he gives back z dollars for each empty can he
gets. (Note: z<y).
Jonas had s dollars in his pocket. Listening to this new system, Jonas was
overwhelmed and wanted to drink as much juice as possible from the s dollars he
had with him. Can you help him to act optimally so that he can drink maximum liters
of juice. Note that only empty cans can be returned and not empty tetra packs in
exchange of money and Adam can buy both tetra packs and cans.
Input Format
The first line of input consists of integer s- the number of dollars he has in his pocket.
Three lines following contains integers x,y,z - the cost of one liter of juice in tetra
prisma pack, the cost of one liter juice in cans and the amount of the money he can
get back by returning empty cans of juice.
Answers
Answered by
0
Explanation:
nznznsmsmsmdkdkmdkddmkdkdkdkd
Similar questions