Given $N$ items where each item has some weight $w_{i}$ and profit associated with it and also given a bag with capacity $W$, (i.e., the bag can hold at most $W$ weight in it). The task is to put the items into the bag such that the sum of profits associated with them is the maximum possible.