Maximum Number of Alloys
Binary search the alloy count: for a fixed count, check whether some machine can buy the missing metal within budget.
Binary search the alloy count: for a fixed count, check whether some machine can buy the missing metal within budget.