You run a company that paints houses. You can hire as many painters as you want, and each painter you hire costs X dollars no matter how long that painter works. On top of that you pay a delay charge: if the job takes D days, the charge is D×P dollars. The charge does not depend on how many painters you hired, and D does not have to be a whole number of days, so you pay only for the exact time taken.
All painters work at the same rate. One painter finishes a house in K days, and they cooperate well enough that M painters finish it in K/M days.
Find the smallest total amount you have to pay for one house, counting both the painters and the delay charge. The number of painters you hire is an integer of at least 1.