Tle in tiling problem

i am not able to resolve TLE while submitting the code
code is:https://ide.codingblocks.com/s/126258

@shakul hey sakul this need dynamic approach if you reached dynamic programming then try it otherwise skip for now