Chain Quine!
We have looked at Quines in TLE '09. Now it is time to work with Chain Quines !. You need to write a program A.Details of A :
Given a number n, it should output the least number >= n which is a power of two.
- Input Specification First Line will contain the number of test cases, T. Then T lines will follow, each containing a single number, n.
- Output Specification If n < 0 the Output the Program B. Else, Output the answer as required by problem.
- Sample Input 2
- Sample Output 4
- Constraints 1 ≤ T ≤ 100.
4
5
8
-1 ≤ n ≤ 10^7 and n != 0.
Details of B :
Given a number n, it should output the greatest number <= n which is a power of two.
- Input Specification First Line will contain the number of test cases, T. Then T lines will follow, each containing a single number, n.
- Output Specification If n < 0 the Output the Program A. Else, Output the answer as required by problem.
- Sample Input 2
- Sample Output 4
- Constraints 1 ≤ T ≤ 100.
4
5
4
-1 ≤ n ≤ 10^7 and n != 0.