Ways To Tile A Floor
Submissions: 15999   Accuracy:

44.78%

  Difficulty: Basic   Marks: 1

Given a floor of dimensions 2 x W and tiles of dimensions 2 x 1, the task is to find the number of ways the floor can be tiled. A tile can either be placed horizontally i.e as a 1 x 2 tile or vertically i.e as 2 x 1 tile.

Input:
The first line of input contains an integer T denoting the number of test cases. The first line of each test case is W.

Output:
Print number of ways the floor can be tiled in a separate line.

Constraints:
1 ≤ T ≤ 50
1 ≤ W ≤ 70

Example:
Input
2
5
3

Output
8
3

Explanation:
Testcase 1:
The number of ways floor can be tiled is 8

** For More Input/Output Examples Use 'Expected Output' option **

Author: rajatjha


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.