Regarding dp problem-book store

sir,i have gone through the following probem
https://hack.codingblocks.com/app/contests/1499/1640/problem
and have watched its solution on faang interview preparation questions videos of coding blocks only.
but i am not getting how recursive case is correct.
can u pls show me the recursive tree for this formula.

Hey @aman17nov1999
I request you to try and make the tree once yourself for the sample case
You can then send it and I’ll help you out in case there is any error in it

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.