BETA

Difficulty Level: Medium

Submissions: 421 Accuracy:

40.14%

Numbers with alternative 1's
       

Given a number n, the task is to find all 1 to n bit numbers with no consecutive 1's in their binary representation.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n.

Output:
Print all those numbers in new line.

Constraints:
1<=T<=20
1<=n<=20

Example:
Input:
2
3
4

Output:
1 2 4 5
1 2 4 5 8 9 10

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

Contributor: Arun Tyagi

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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