Question meaning - AS SOON AS POSSIBLE

Can you please explain me the meaning of this question. I don’t need the code, just the explanation.

PROBLEM STATEMENT:
There are two towns A and B respectively. Both the towns are organizing an international trade festival. Initially, you have n bitcoins. Now, as you are fond of trading, firstly you decide to go to town A and participate in some finite number of the trade process. Then you decide to go to town B and participate in some finite number of trade processes in town B and finally, you return again to town A and participate in some finite number of the trade processes.

A trade process in town x={A, B} can be one among the following (any number of times in any order) -

Pay gx bitcoins and get 1 unit gold.
Pay 1 unit gold and get gx bitcoins.
Pay sx bitcoins and get 1 unit silver.
Pay 1 unit silver and get sx bitcoins.
Pay bx bitcoins and get 1 unit bronze.
Pay 1 unit bronze and get bx bitcoins.
Note: You can only participate in a trade process if neither the number of bitcoins nor the count of units of any of the coins goes less than zero.

You need to find the maximum number of bitcoins you can achieve at last. The number of units of gold, silver and bronze in the end does not matter.

Input Format
The first line of input contains n (1≤ n ≤ 5000), the number of bitcoins initially.

Next two lines contain gx, sx and bx (1 ≤ gx,sx,bx ≤ 5000).

Output Format
Print a single integer, the maximum number of bitcoins at the end.

Initially, a Person have n bitcoins.
then he goes into 2 towns A and B do some trades process
like that
Pay gx bitcoins and get 1 unit gold.
Pay 1 unit gold and get gx bitcoins.
Pay sx bitcoins and get 1 unit silver.
Pay 1 unit silver and get sx bitcoins.
Pay bx bitcoins and get 1 unit bronze.
Pay 1 unit bronze and get bx bitcoins.

at end you have to print max no of bitcoins you can have

in between you must have some money either in form of silver,bronze ,gold or in form of bitcoins so that you can trade

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

where can i get the solution for this???

i need answer to this question sir??

did u get the answer
if u got share to me sis

1 Like

Ans for this share it

please share the link of the question so i can submit my code