Problem 309 (Div2) C, Kyoya and Colored Balls
I am trying a DP approach and I couldn't think of bottom-up so I am thinking the solution might involve top-down DP approach. This seems like something that can be a variation of knapsack.
Can someone give non-revealing/small hints to pursue this problem? In general, how do you identify subproblems?
Thanks