Solve problem "The power of two" online - Learn Python 3 - Snakify

Problem «The power of two» (Medium)


Statement

For a given integer N, find the greatest integer x where \( 2^x \) is less than or equal to N. Print the exponent value and the result of the expression \( 2^x \).

Don't use the operation **.


In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
50
5 32
10
3 8
8
3 8
7
2 4
1
0 1
2
1 2
3
1 2
4
2 4
5
2 4
100
6 64
1025
10 1024
15431543
23 8388608