Please explain test case

for 12 can i get 6 ,4,3 all three exchange are possible on same time or

@rsaini9416624750 12 is divided into 3 coins 6 4 3 and now you sold all three so 6+4+3=13 golds you can get. hope its clear if yes dont forget to mark it as resolved and hit like :smiley:

how i can create dp[10^9] tell if my dp is wrong error due to size of dp or something else

@rsaini9416624750 just use dp upto 1e6 here refer this

y you are using dp for 1e6 only y not for larger value

@rsaini9416624750 i am memorising only upto 1e6 as you know dp array bigger than this will give runtime error. so my code only remember results less than equal 1e6