Vivek is bored with his plain walls in his room and decided to design one of the walls with laminates. He ordered some wall laminates for the wall that he wants to decorate.
He ordered N different sized (not necessarily unique) laminates to do the work.
The height of the wall as well as all the laminates is fixed and is the same.
There is a beauty factor assigned to each laminate which represents the beauty of the laminate. (Higher the beauty factor, more beautiful the laminate is)
Width of the wall is fixed and represented by the variable W.
Width of each laminate is represented by w1, w2, ... , wN.
Beauty of each laminate is represented by b1, b2, ... , bN.
Beauty of the wall is defined as the total of beauty of laminates pasted.
Also, there is a limit to the number of laminates to be pasted as pasting more and more laminates may degrade the overall beauty. This limit is represented by the variable L.
You need to maximise the beauty of the wall by pasting the laminates to the wall so that Vivek’s boring days are over in the best possible way.
NOTES
We can use 1 laminate each of width 4 an 6 (3rd and 4th laminate respectively), resulting in total beauty of 42 + 97 = 139