# Unbounded Knapsack

#### Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

`1. You are given a number n, representing the count of items.2. You are given n numbers, representing the values of n items.3. You are given n numbers, representing the weights of n items.3. You are given a number "cap", which is the capacity of a bag you've.4. You are required to calculate and print the maximum value that can be created in the bag without     overflowing it's capacity.Note -> Each item can be taken any number of times. You are allowed to put the same item again                   and again.`
Input Format
`A number nv1 v2 .. n number of elementsw1 w2 .. n number of elementsA number cap`
Output Format
`A number representing the maximum value that can be created in the bag without overflowing it's capacity`
Question Video
Constraints
`1 <= n <= 200 <= v1, v2, .. n elements <= 500 < w1, w2, .. n elements <= 100 < cap <= 10`
Sample Input
`515 14 10 45 302 5 1 3 47`
Sample Output
`100`

• Related Topics

Run

Run
Id Name