1. 8
  1.  

  2. 2

    This is the backpack problem - https://en.wikipedia.org/wiki/Knapsack_problem