`{"id":"45ac8469-cf65-4849-a9e7-20e03617bc78","name":"Tiling With M * 1 Tiles","description":"1. You are given a number n and a number m separated by line-break representing the length and breadth of a m * n floor.\r\n2. You've an infinite supply of m * 1 tiles.\r\n3. You are required to calculate and print the number of ways floor can be tiled using tiles.","inputFormat":"A number n\r\nA number m","outputFormat":"A number representing the number of ways in which the number of ways floor can be tiled using tiles.","constraints":"1 &lt;= n &lt;= 100\r\n1 &lt;= m &lt;= 50","sampleCode":{"cpp":{"code":"#include <iostream>\n#include <vector>\n\nusing namespace std ;\n\n int main() {\n int n ;\n cin>>n ;\n int m ;\n cin>>m ;\n // write your code here\n \n }"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n}"},"python":{"code":"def No_of_ways(n , m):\n #Write your code here \n \nif __name__ == '__main__':\n \n n = int(input())\n m = int(input())\n \n print(No_of_ways(n , m))"}},"points":10,"difficulty":"easy","sampleInput":"39\r\n16","sampleOutput":"61","questionVideo":"https://www.youtube.com/embed/_c_R-uIi-zU?end=52","hints":[],"associated":[{"id":"0773bc7f-2391-44a9-ae1b-61cfc5a01629","name":"What is time complexity to tile n*m sized floor where tile is of m*1 size?","slug":"what-is-time-complexity-to-tile-n-m-sized-floor-where-tile-is-of-m-1-size","type":4},{"id":"0823271d-8965-4dcb-923f-39bf0b267a16","name":"For n == m what value will be stored in storage?","slug":"for-n-m-what-value-will-be-stored-in-storage","type":4},{"id":"41a74139-fef9-47b6-b427-e547a7b8fa3e","name":"What is the meaning of cells present in storage?","slug":"what-is-the-meaning-of-cells-present-in-storage","type":4},{"id":"bb5bb0c6-7cba-4186-809c-4564a3a2569d","name":"DP optimizes the solution by taking advantage of which of the following:","slug":"dp-optimizes-the-solution-by-taking-advantage-of-which-of-the-following","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"52d62581-1313-45fb-aaf0-1d72a45f6a50","name":"Dynamic Programming And Greedy For Beginners","slug":"dynamic-programming-and-greedy-for-beginners","type":0},{"id":"53618500-d1cb-4fef-8e00-b9baa92a32d5","name":"Tiling With M * 1 Tiles","slug":"tiling-with-m-1-tiles","type":1}],"next":{"id":"2aca84b8-3c1e-4ad2-918c-b4b20c1394d6","name":"Tiling With M * 1 Tiles","type":3,"slug":"tiling-with-m-1-tiles"},"prev":{"id":"1f8a5074-a75d-49f2-bcd8-0ef19c03a771","name":"Tiling with 2x1 tiles","type":3,"slug":"tiling-with-2x1-tiles"}}}`

# Tiling With M * 1 Tiles

1. You are given a number n and a number m separated by line-break representing the length and breadth of a m * n floor. 2. You've an infinite supply of m * 1 tiles. 3. You are required to calculate and print the number of ways floor can be tiled using tiles.

`{"id":"45ac8469-cf65-4849-a9e7-20e03617bc78","name":"Tiling With M * 1 Tiles","description":"1. You are given a number n and a number m separated by line-break representing the length and breadth of a m * n floor.\r\n2. You've an infinite supply of m * 1 tiles.\r\n3. You are required to calculate and print the number of ways floor can be tiled using tiles.","inputFormat":"A number n\r\nA number m","outputFormat":"A number representing the number of ways in which the number of ways floor can be tiled using tiles.","constraints":"1 &lt;= n &lt;= 100\r\n1 &lt;= m &lt;= 50","sampleCode":{"cpp":{"code":"#include <iostream>\n#include <vector>\n\nusing namespace std ;\n\n int main() {\n int n ;\n cin>>n ;\n int m ;\n cin>>m ;\n // write your code here\n \n }"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n}"},"python":{"code":"def No_of_ways(n , m):\n #Write your code here \n \nif __name__ == '__main__':\n \n n = int(input())\n m = int(input())\n \n print(No_of_ways(n , m))"}},"points":10,"difficulty":"easy","sampleInput":"39\r\n16","sampleOutput":"61","questionVideo":"https://www.youtube.com/embed/_c_R-uIi-zU?end=52","hints":[],"associated":[{"id":"0773bc7f-2391-44a9-ae1b-61cfc5a01629","name":"What is time complexity to tile n*m sized floor where tile is of m*1 size?","slug":"what-is-time-complexity-to-tile-n-m-sized-floor-where-tile-is-of-m-1-size","type":4},{"id":"0823271d-8965-4dcb-923f-39bf0b267a16","name":"For n == m what value will be stored in storage?","slug":"for-n-m-what-value-will-be-stored-in-storage","type":4},{"id":"41a74139-fef9-47b6-b427-e547a7b8fa3e","name":"What is the meaning of cells present in storage?","slug":"what-is-the-meaning-of-cells-present-in-storage","type":4},{"id":"bb5bb0c6-7cba-4186-809c-4564a3a2569d","name":"DP optimizes the solution by taking advantage of which of the following:","slug":"dp-optimizes-the-solution-by-taking-advantage-of-which-of-the-following","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"52d62581-1313-45fb-aaf0-1d72a45f6a50","name":"Dynamic Programming And Greedy For Beginners","slug":"dynamic-programming-and-greedy-for-beginners","type":0},{"id":"53618500-d1cb-4fef-8e00-b9baa92a32d5","name":"Tiling With M * 1 Tiles","slug":"tiling-with-m-1-tiles","type":1}],"next":{"id":"2aca84b8-3c1e-4ad2-918c-b4b20c1394d6","name":"Tiling With M * 1 Tiles","type":3,"slug":"tiling-with-m-1-tiles"},"prev":{"id":"1f8a5074-a75d-49f2-bcd8-0ef19c03a771","name":"Tiling with 2x1 tiles","type":3,"slug":"tiling-with-2x1-tiles"}}}`

Editor

# Tiling With M * 1 Tiles

easy

1. You are given a number n and a number m separated by line-break representing the length and breadth of a m * n floor. 2. You've an infinite supply of m * 1 tiles. 3. You are required to calculate and print the number of ways floor can be tiled using tiles.

## Constraints

1 <= n <= 100 1 <= m <= 50

## Format

### Input

A number n A number m

### Output

A number representing the number of ways in which the number of ways floor can be tiled using tiles.

## Example

Sample Input

```.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}39 16```

### Sample Output

`.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}61`

Question Video

Discussions

Show Discussion

Related Resources