Getting wrong answer


where i am doing wrong here

This question is similar to 0-1 knapsack problem.