Maximize workshop productivity within budget

Problem Each labourer has a fee and a productivity value; with a total budget, maximize the productivity of the workshop you can assemble. (Pin the exact objective with examples — typical OA phrasing makes it "maximize the minimum productivity" or "max total productivity of hired set" — the binary-search framing implies the former.)

Input / Output

  • Input: arrays fee[], productivity[], int budget. Output: max achievable productivity target.

Constraints

  • n up to 10^5 — an O(n log maxP) binary-search-on-answer is expected.

Example

  • Threshold form: to check productivity level P, hire only labourers with productivity >= P; feasible iff the cheapest such subset meeting the workshop's requirement fits the budget.
asked …
LeaderboardSalaryAccount