i do not get how to write the code for this please explain and also explain this line is question “Print answer for every test case in a new line modulo 10^9+7.”
Tilling problem 2
This problem can be done with all test cases pass only with Dynamic Programming. So i would suggest you to attempt this after that.
However for the approach, you can refer these:
Watch tilling problem 1…lecture video this is very similar to that.
Refer this Please help me to understand the question
I have explained a test case here.
We have to find a recursive relation to tile a floor of size 4 x N given tile size is 1 x 4
When you keep the tile vertically, number of ways of tiling the remaining floor is f(n-1) as n-1 is the remaining width.
When you keep the tiles horizontally, number of ways of tiling remaining floor is f(n-4).
So total number of ways pf tiling is the sum of both.