Heaps -- Costs and Profits

enter:

Parameter 1, positive array costs

Parameter 2, positive array profits

Parameter 3, positive number k

parameter 4, positive number m


costs[i] represents the cost of item i

profits[i] represents the money (profit) that the item i can earn after deducting expenses

k means that you cannot do at most k projects in parallel and can only be done in series. m means your initial capital
description: every time you finish a project, the income you get immediately can support you to do the next project.
Output: The maximum amount of money you last earned.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324958961&siteId=291194637