2861. Maximum Number of Alloys
You are the owner of a company that creates alloys using various types of metals. There are
ndifferent types of metals available, and you have access tokmachines that can be used to create alloys. Each machine requires a specific amount of each metal type to create an alloy.For the
ithmachine to create an alloy, it needscomposition[i][j]units of metal of typej. Initially, you havestock[i]units of metal typei, and purchasing one unit of metal typeicostscost[i]coins.Given integers
n,k,budget, a 1-indexed 2D arraycomposition, and 1-indexed arraysstockandcost, your goal is to maximize the number of alloys the company can create while staying within the budget ofbudgetcoins.All alloys must be created with the same machine.
Return the maximum number of alloys that the company can create.
1 |
|