If you pick a worker with ratio , all workers in your group must be paid at ratio at least (to meet everyone's minimum wage). Sort workers by ratio.
For each worker, consider them as the "captain" who sets the payment ratio. The total cost is their ratio times the total quality of the group.
To minimize cost with a fixed ratio, you want minimum total quality. Use a max-heap to track the workers with smallest quality among those with ratio captain's ratio.