Hello everyone!!

Consider the Fitting Shelves Problem

The solution : We can consider all multiples of "m" less than equal to "w" to find the minimum remaining space.

My claim : We only have to consider the highest or second highest multiple of "m" to find the minimum remaining space.

Actually I have not been able to prove this but it works correctly on most of the inputs. So, any prove as to why this will work correctly or any contradictory test case that fails with this approach will be highly appreciated.

Thanks in advance :)