maxAlloys to keep track of the maximum number of alloys that can be created across all machines.mid alloys with the current machine within the budget.
iii. If it is possible, update the low end to mid + 1 and set maxAlloys to mid if it's greater than the current maxAlloys.
iv. If it's not possible, update the high end to mid - 1.maxAlloys.