Greedy Algorithms

Answer & solution
Official answer: 16
Step through it (2 tables)
Method
The ratio order is item 4 then 1 then 3 then 2. Taking item 4 leaves 9 kg, so item 1 no longer fits. Item 3 then fits and leaves 5 kg, too little for item 2. To verify optimality, item 1 alone gives 60 and cannot pair with even the smallest other item. Without item 1, feasible pairs (2,3),(2,4),(3,4) have values 48,52,44; all three weigh 13 and are infeasible. Thus exhaustive feasible alternatives confirm the optimum.
Solution
Value/weight ratios order the items as 4, 1, 3, 2, with ratios 12, 6, 5, 4. Greedy takes item4 (weight 2, value 24), skips item1 because it no longer fits, then takes item3 (weight 4, value 20), and skips item2. Its value is 44. The best feasible subset is item1 alone, value 60: pairs among 2, 3, 4 have maximum 52, all three weigh13, and item1 cannot accompany any other item under capacity 11. Hence60−44=16.