Mixtures DP Problem on Hackerblocks

https://hack.codingblocks.com/app/practice/9/298/problem

How to approach this problem using DP ??
I am not getting the logic

hi @ashwani225 this problem uses a concept very similar to Matrix chain multiplication, are you familiar with that? There is a hint video of this problem you can see that also

Hint Video where is it ??

@ashwani225 please look for it in the course, if you cant find it it is using the same idea as MCM so you can watch that too

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.