Example:
W = 50
The greedy solution would select 1, leaving 40 pounds.
At this point if we pick items 1 and 2 the total value is 160.
If we pick items 1 and 3 the total value is 180.
The optimal solution is to pick items 2 and 3. The total value of this solution is 220.