Unbounded knapsack with condition that number of items taken be has to be a fibonacci number

Revision en5, by vib_1, 2020-05-12 13:37:17

How to solve the following question

You are given two integer arrays of size N, W(weight) and V(values), an infinite quantity of any item is available, You have to maximize the sum of values such that total weight is less than or equal to capacity C and the total number of items taken is a Fibonacci number

1 <= N <= 1000
1 <= C <= 1000
1 <= W(i) <= 1000
1 <= V(i) <= 1000

P.S. This was an interview question

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English vib_1 2020-05-12 13:37:17 92 Tiny change: 'tity of an item is a' -> 'tity of any item is a' (published)
en4 English vib_1 2020-05-12 13:14:53 411 (saved to drafts)
en3 English vib_1 2018-08-15 07:12:35 107
en2 English vib_1 2018-08-14 20:58:40 39 Tiny change: 'Given an a' -> 'How to solve the following question\n\nGiven an a'
en1 English vib_1 2018-08-14 20:58:03 358 Initial revision (published)