[R] Exhaustive Search : Knapsack problem (poor solution)