Tilling Problem - II elaborate

https://online.codingblocks.com/player/28486/content/4669/5208
Can you elaborate how the given test cases are calculated.
I mean from question if tiles are of size 1xm then at max the answer will always be 2.
one for horizontally and one vertically.

hey @mddanish,
when n=2 m=3, there is only one way which is to place 2 tiles vertically covering area 2X3, so ans is 1

when n=4 m=4, there are 2 ways
1st- place 4 tiles vertically, covering area 4X4
2nd- placeing 3 tiles horizontally, covering 3X4= 12 area out of 16 and 1 tile vertically covering 1X4=4 area out of 16.
So ans is 2

Draw the diagram for better understanding.

how can we place 1x4 tile vertically as there is already placed three tiles in above rows. Only left row is 4th so we can only place horizontally.

hey @mddanish, sorry i explained you something else, here is correct explanation

when n=2 m=3, there is only one way which is to place 2 tiles horizontally covering area 2X3, so ans is 1

when n=4 m=4, there are 2 ways
1st- place 4 tiles vertically, covering area 4X4=16
2nd- placeing 4 tiles horizontally, covering 4X4=16 .
So ans is 2

Draw the diagram for better understanding.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.