Dynamic Programming to Maximize Profit
In this particular case, you can just go over all possibilities.

The dynamic programming approach is to compute recursively the maximal profit that can be obtained from using $x$ refrigerators in the first $y$ stores (and not using any in the other stores). I'll let you fill in the missing details.