Knapsack Problem solution using Dynamic Programming

0-1 knapsack Problem Solution using Dynamic Programming. 
Test Case:
3
50
60 100 120
10 20 30
Output:
Items contributing to maximum value
Item #: 3
Item #: 2