Tilling problem -||

sir what is the scenario , when n>>m , please explain this case.

You have to solve this question using 1-D dp ( dynamic proramming ) array, and if you didnt understood the sample case, let me know.