Most Significant Bit

Easy

The most significant bit of a number n is the left most set bit in its binary representation.

The significance of that bit is determined by its position.

Given a number n, find the significance of the most significant bit, i.e., find the greatest number less than or equal to n which is the power of two.

Testing

Input Format

The first line contains an integer ‘T’ denoting the number of test cases.

For each test case, there exists one line containing an integer ‘n’ denoting the number.

Output Format

For each test case, the output contains a line with the significance of the most significant bit of n.

Sample Input

2
4
10

Expected Output

4
8

Constraints

1 <= T <= 105
1 <= n <= 109

Companies
Editorial Link: Editorial