Most Profit Plan
A workshop makes several products. One unit of product j earns profit[j] and uses use[i][j] hours of machine i, and machine i has hours[i] hours. Any amounts can be made, fractions included, but not negative ones. Return the largest total profit. Answers within 0.001% are accepted.
Example 1
profit [3,5]
use [[1,0],[0,2],[3,2]]
hours [4,12,18]
returns 36.0
Make 2 of the first product and 6 of the second: 3 * 2 + 5 * 6 = 36, using every hour of the last two machines.
Constraints
- 1 to 5 products, 1 to 5 machines
- Every product uses some time on at least one machine
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More SciPy problems
- Safest MixHard
- Smallest Total MissHard
- Volume Over a TriangleHard
- Area Under the PointsBeginner
- Chance of at MostBeginner
- City Block DistanceBeginner
- Percent at or BelowBeginner
- Standard ErrorBeginner