You are given two integer arrays, t[] and cost[], each containing n values, along with an integer budget B.
Implement:
def max_min_throughput(t, cost, B):
For every service i, choose a non-negative integer scale amount x_i.
t[i] * (1 + x_i).x_i costs x_i * cost[i].Σ x_i * cost[i] ≤ B.min_i(t[i] * (1 + x_i)).Return the greatest pipeline throughput that can be obtained, as an integer.
Input: t = [4, 7], cost = [3, 2], B = 8
Output: 12
A target of 12 requires scale amounts 2 and 1, costing 2 * 3 + 1 * 2 = 8; the resulting throughputs are 12 and 14, so the minimum is 12. Reaching 13 would require three scale-ups for the first service and exceed the budget.
Input: t = [5, 3, 8], cost = [4, 1, 6], B = 5
Output: 6
Scaling the first service once and the second service twice costs 4 + 2 = 6, so a target of 7 is impossible. A target of 6 costs only 4 + 1 = 5, making the resulting minimum throughput 6.
Input: t = [6, 9], cost = [2, 5], B = 0
Output: 6
No scaling is affordable, so the pipeline remains limited by the service with initial throughput 6.
1 ≤ n = len(t) = len(cost)1 ≤ t[i] ≤ 10^91 ≤ cost[i] ≤ 10^9