My version of knapsack solution, for now only 3 first tasks can be solved.