{"id":"33bce77d-2a42-4f91-a5ab-565a56b04380","name":"Floor Tiling - 2","description":"1. You are given a number N.\r\n2. You have two types of tiles: a 2x1 domino shape, and an \"L\" tromino shape. \r\n3. You have to find the number of ways to tile a 2*N dimensional floor.\r\n\r\nNote -> You can also rotate the tiles.","inputFormat":"A number N","outputFormat":"Print your answer modulo 10^9+7.","constraints":"1 <= N <= 1000","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n\tpublic static int solution(int N) {\r\n\t\t//write your code here\r\n\r\n\t\treturn 0;\r\n\t}\r\n\t\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint n = scn.nextInt();\r\n\t\tSystem.out.println(solution(n));\r\n\t}\r\n\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"3","sampleOutput":"5\r\n","questionVideo":"","hints":[],"associated":[],"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":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"4a55a33b-92dc-4886-adc6-5aec5c429e68","name":"Floor Tiling - 2","slug":"floor-tiling-2","type":1}],"next":{"id":"aa8da00b-d6fa-44f5-b9d6-a7abd343efb1","name":"FLOOR TILING-2 MCQ","type":0,"slug":"floor-tiling-2-mcq"},"prev":{"id":"0845c358-1efd-4102-89f5-8386d6c504be","name":"Egg Drop","type":3,"slug":"egg-drop"}}}

Floor Tiling - 2

1. You are given a number N. 2. You have two types of tiles: a 2x1 domino shape, and an "L" tromino shape. 3. You have to find the number of ways to tile a 2*N dimensional floor. Note -> You can also rotate the tiles.

{"id":"33bce77d-2a42-4f91-a5ab-565a56b04380","name":"Floor Tiling - 2","description":"1. You are given a number N.\r\n2. You have two types of tiles: a 2x1 domino shape, and an \"L\" tromino shape. \r\n3. You have to find the number of ways to tile a 2*N dimensional floor.\r\n\r\nNote -> You can also rotate the tiles.","inputFormat":"A number N","outputFormat":"Print your answer modulo 10^9+7.","constraints":"1 <= N <= 1000","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n\tpublic static int solution(int N) {\r\n\t\t//write your code here\r\n\r\n\t\treturn 0;\r\n\t}\r\n\t\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint n = scn.nextInt();\r\n\t\tSystem.out.println(solution(n));\r\n\t}\r\n\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"3","sampleOutput":"5\r\n","questionVideo":"","hints":[],"associated":[],"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":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"4a55a33b-92dc-4886-adc6-5aec5c429e68","name":"Floor Tiling - 2","slug":"floor-tiling-2","type":1}],"next":{"id":"aa8da00b-d6fa-44f5-b9d6-a7abd343efb1","name":"FLOOR TILING-2 MCQ","type":0,"slug":"floor-tiling-2-mcq"},"prev":{"id":"0845c358-1efd-4102-89f5-8386d6c504be","name":"Egg Drop","type":3,"slug":"egg-drop"}}}
plane

Editor


Loading...

Floor Tiling - 2

medium

1. You are given a number N. 2. You have two types of tiles: a 2x1 domino shape, and an "L" tromino shape. 3. You have to find the number of ways to tile a 2*N dimensional floor. Note -> You can also rotate the tiles.

Constraints

1 <= N <= 1000

Format

Input

A number N

Output

Print your answer modulo 10^9+7.

Example

Sample Input

3

Sample Output

5

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode