Description: Description: The need for a capacity of c backpack loaded. Loaded backpack of items selected from n items, items i weight of wi, the value of pi. Feasible backpack load, the total weight of the items in the backpack can not exceed the capacity of the backpack, the best load is the highest value of goods loaded. Input: more test cases, each input test cases accounted for three lines. The first row of two integers: n (n < = 10), and c, the second row of n integers are W1 to WN n integers, respectively, of the third row is the p1 to Pn. n and c are equal to zero to the end of the flag input. Output: the output of each test cases per line, output an integer, that is the best total value loaded. SAMPLE INPUT: 1 2 1 1 2 3 2 2 3 4 0 0 sample output: 14
To Search:
File list (Check if you may need any files):
Knapsack\.classpath
........\.project
........\src\Knapsack.java
........\bin\Knapsack.class
........\src
........\bin
Knapsack