I am solving this question and i think it is very similar to Knapsack problem.
I am not able to figure out how to use knapsack in this problem.
I tried it using knapsack but i am getting TLE.
Can anyone please help me by sharing their approach(code).
question link: CodeChef: Practical coding for everyone
Thanks in advance.