From http://blog.csdn.net/shuangde800
Question link: Click the open link
Question
There are n warehouses for m to look. One warehouse can only be managed by one person, and one person can manage multiple warehouses.
Each person has a capacity pi. If he takes care of K warehouses, the security value of each warehouse is PI/K (rounded down)
If a warehouse is unattended, its security value is 0. Security value of all warehouses L = min {security value of each warehouse}
If you hire a person whose salary is equal to his capacity Pi.
Select some employees from M and ask the maximum security value of all warehouses. In the case of the highest security value, find the minimum price for employment.
Ideas
F [I] [J] indicates the maximum security value of the previous one who manages J warehouses.
F [I] [J] = max {min {f [I-1] [J-K], p [I]/k }, 0 <= k <= J & K is the number of warehouses managed by the I user}
Then ask for the minimum price,
G [I] [J] indicates the minimum price used to manage the maximum security values of the first I people in the warehouse.
G [I] [J] = min {G [I-1] [J-K] + P [I], P [I]/k> = f [m] [N] & 0 <= k <= J}
Code