In the obsidian flows of Blackglass, Farmer the inventory keeper keeps careful count of the vaults. assign crews to the morning shifts, every figure matters. Task: n items each have a weight and a value; take each at most once within capacity W. Print the maximum total value. Input format: First line: n and W. Second line: n weights. Third line: n values. Output format: Print the maximum value. Constraints: 1 <= n <= 100; 1 <= W <= 10000; 1 <= wi,vi <= 10^6.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 100; 1 <= W <= 10000; 1 <= wi,vi <= 10^6.
