Question is not clear

Say we have n=10
then 10 is only divisible by 2, so 10 can be exchanged for 5 2 rupees coins or 10/3=3 or 3 rupees coin also

can provide some other test cases also

yes also consider 10/3=3 also

A coin n can be exchanged in a bank into three coins: n/2, n/3 and n/4

for 12 you go to bank exchange it into 6 4 3
now you can get 6+4+3=13 gram of gold
So 13 is ans

i hope this helps
Please mark doubt as resolved :grinning:
if you have more doubts regarding this feel free to ask

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.