BETA

Difficulty Level: Basic

Submissions: 694 Accuracy:

61.1%

Smallest power of 2 greater than or equal to n
     

Given a number N, Write a program to find a number which is greater than or equal to N and is a smallest power of 2.

Input:
First line of input contains a single integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains a single integer N.

Output:
For each test case, print a number which is greater than or equal to N and is a nearest power of 2.

Constraints:
1<=T<=100
1<=N<=100000

Example:
Input:
4
5
1
17
32
Output:
8
1
32
32

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

Contributor: Harsh Agarwal

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.