Answer to Question #38802 in C++ for Ahsan
Given the value of a block in grams as input, write a program that would print the largest possible currency value that you can receive as the out put. Assume that the maximum value of a block that can be given as an input is 1,000,000,000 grams ans the minimum value is 2 grams.
Sample input 1:
Sample output 1:
Explanation: you can change 12 into blocks of 12/2=6, 12/3=4, and 12/4=3 and then exchange these for 6+4+3=13 units of currency
SAMPLE INPUT 2:
SAMPLE OUTPUT 2:
EXPLANATION: if you exchange 3 grams into smaller blocks, it gives 2/2=1,2/3=0and2/4=0 only 1 unit.
Unfortunately, your question requires a lot of work and cannot be done for free.
Please submit it with all requirements as an assignment to our control panel and
we'll assist you.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!