Hint for box stacking problem

i am not getting any idea of how to approach to this problem… can someone plz help me on this

hello @Shobhit_kumar

have u solved the LIS dp problem ?
if yes then try to think in that direction

https://ide.codingblocks.com/s/350643 sir i have tried this using LIS and it is passing the sample cases also but why it is giving wrong answer??

@Shobhit_kumar
check for following example->
1
1
531 16843 8362

correct output is
17374

sir where do you see these random egs from and how do you get the expected output for the same. plz tell me also so that it will help me alot in coding blocks platform… also plz tell me what changes i can made in my code bcoz i am not finding any logical error in my code. please help on this

sir i got AC after changing min and max condition for the first case also

but plz tell me how do you get expected output for random test cases

i dont have any startergy for this.
either i run code on some random test case or i take help of hidden test cases

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.