Problem:
 Score : 200 points    Problem Statement Takahashi loves numbers divisible by 2 .  You are given a positive integer N . Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.  Here, the number of times an integer can be divisible by 2 , is how many times the integer can be divided by 2 without remainder.  For example,   6 can be divided by 2 once: 6 -> 3 .  8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1 .  3 can be divided by 2 zero times.       Constraints  1 ≤ N ≤ 100         Input Input is given from Standard Input in the following format:  N       Output Print the answer.        Sample Input 1 7      Sample Output 1 4  4 can be divided by 2 twice, which is the most number of times among 1 , 2 , ..., 7 .       Sample Input 2 32      Sample Output 2 32       Sample Input 3 1      Sample Output 3 1       Sample Input 4 100      Sample Output 4 64

Solution (Python):
n = int(input())

if n == 1:
    print("1")
    exit()

for i in range(n):
    if 2**i > n:
        ans = 2**(i-1)
        break

print(ans)

Solution (Python):
N = int(input())
n = 1

while n <= N:
    n *= 2

print(n//2)

Solution (Python):

N=int(input())

l=[]
l=[0]*(N)
for i in range(N):
	d=i
	l[d]=0 
	pra=i+1
	while pra%2==0:
		pra/=2
		l[d]+=1


for i in range(N):
	if(l[i]==max(l)):
		print(i+1)

Solution (Python):
def counter(n):
  count = 0
  while(n%2 == 0):
    count += 1
    n = int(n/2)
  return count

N = int(input())
max = 0
ans = 1
for i in range(N):
  if(max < counter(i+1)):
    max = counter(i+1)
    ans = i+1
    
print(ans)

Solution (Python):
N = int(input())

if(N<2):
  print(N)
elif(2<=N<4):
  print(2)
elif(4<=N<8):
  print(4)
elif(8<=N<16):
  print(8)
elif(16<=N<32):
  print(16)
elif(32<=N<64):
  print(32)
elif(64<=N):
  print(64)

Solution (Python):
n = int(input())
s = 1
while n >= s:
    x = s
    s*=2

print(x)

Solution (Python):
n=int(input())
s=1
while n>=s:
    s*=2
print(s//2)

Solution (Python):
lst = []
for i in range(1, int(input()) + 1):
    count = 0
    while i % 2 == 0:
        i /= 2
        count += 1
    lst.append(count)
num = max(lst)
print(lst.index(num) + 1)

Solution (Python):

import numpy as np
n=int(input())
print(2**int(np.log2(n)))

Solution (Python):
import sys
n=input()
kaisuu = 0
ans = 0
if int(n) == 1:
    print(1)
    sys.exit()
for i in range(1,int(n)+1):
    count = 0
    num = i
    while(num % 2 == 0):
        count = count + 1
        num /= 2
    if kaisuu < count:
        kaisuu = count
        ans = i

print(ans)

Solution (Python):
n=int(input())
x=[1,2,4,8,16,32,64]
for i in range(n):
    if n in x:
        print(n)
        break
    n-=1

Solution (Python):
def num2(n):
  ans=0
  while n%2==0:
    ans+=1
    n//=2
  return ans
N=int(input())
l=[[i,num2(i)] for i in range(1,N+1)]
l.sort(key=lambda x:x[1],reverse=True)

print(l[0][0])

Solution (Python):
N = int(input())

for i in range(8,0,-1):
  if(2**i <= N):
    print(2**i)
    break
else:
  print(1)

Solution (Python):
n = int(input())
a = 1
while a <= n/2:
    a = a*2
print(a)

Solution (Python):
n=int(input())
a=[2**s for s in range(8)]
for s in range(8):
  if n<a[s]:print(a[s-1]);exit()

Solution (Python):
from math import log2
N = int(input())
print(2**int(log2(N)))

Solution (Python):
N = int(input())

ans = 1

while True:
    if N < ans << 1:
        break
    ans <<= 1

print(ans)

Solution (Python):
N = int(input())
if N == 1:
    print(1)
else:
    ans = 2
    while ans * 2 <= N:
        ans *= 2
    print(ans)

Solution (Python):
import math
n=int(input())
wari=0
ans=0
for i in range(1,n+1):
    tmp=int(math.log2(i))
    if tmp>wari:
        wari=tmp
        ans=i
print(ans if n!=1 else 1)

Solution (Python):
L = [2**i for i in range(0,7)]
N = int(input())
L = list(filter(lambda x:x<=N,L))
print(L[-1])

Solution (Python):
L = [2**i for i in range(7)]
N = int(input())
if N in L:
    print(N)
    quit()
L.append(N)
L = sorted(L)
n =  L.index(N) 
print(L[n-1])

Solution (Python):
n = int(input())
for i in range(n):
    if 2**i == n:
        print(2**i)
        break
    elif 2**i > n:
        print(2**(i-1))
        break

Solution (Python):
L = [2**i for i in range(1,7)][::-1]
N = int(input())
if N == 1:
    print(1)
    exit()

for i in range(len(L)):
    if N >= L[i]:
        print(L[i])
        exit()

Solution (Python):
import math
print(2**int(math.log2(int(input()))))

Solution (Python):
n=int(input())
lst=[2**i for i in range(6,-1,-1)]
for i in lst:
    if i<=n:
        print(i)
        exit()

Solution (Python):
N = int(input())
ans = [2 ** i for i in range(0, 7)]

for i in range(len(ans)):
    if ans[i] > N:
        print(ans[i-1])
        exit(0)
print(64)

Solution (Python):
n=int(input())
A=[64,32,16,8,4,2,1]
for i in A:
  if i<=n:
    print(i)
    exit()

Solution (Python):
n = int(input())
ans = 1
while ans * 2 <= n:
  ans *= 2
print(ans)

Solution (Python):
n=int(input())
a=1
while(a<=n):
  a*=2
print(a//2)

Solution (Python):
int_n = int(input())

for i in reversed(range(8)):
    result = 2 ** i
    if result <= int_n:
        print(result)
        exit(0)

Solution (Python):
N = int(input())
for k in range(1,8):
    if(N < 2**k):
        ans = 2**(k-1)
        break

print(ans)

Solution (Python):
n_b = bin(int(input()))[::-1]
print(2**(n_b.index("b")-1))

Solution (Python):
N = int(input())

if N == 1:
    print(1)
elif N < 4:
    print(2)
elif N < 8:
    print(4)
elif N < 16:
    print(8)
elif N < 32:
    print(16)
elif N < 64:
    print(32)
elif N < 101:
    print(64)

Solution (Python):
def main():
    n = int(input())

    l = []
    for i in range(1, n + 1):
        k = i
        c = 0
        while k % 2 == 0:
            c += 1
            k = k // 2
        l.append(c)
    print(l.index(max(l)) + 1)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
val = 1

while val <= N:
    val *= 2

mod_2 = divmod(val, 2)
mod_2 = mod_2[0]
print(mod_2)

Solution (Python):
n = int(input())

ans_list = [64, 32, 16, 8, 4, 2, 1]
for i in ans_list:
    if n >= i:
        print(i)
        exit()

Solution (Python):
n = int(input())

i = 0
while True:
    if n == 0:
        print(2 ** (i - 1))
        break
    n //= 2
    i += 1

Solution (Python):
n = int(input())

max_cnt = 0
ans = 0
for i in range(1, n+1):
    cnt = 0
    x = i
    while x % 2 == 0:
        x //= 2
        cnt += 1
    if cnt >=  max_cnt:
        max_cnt = cnt
        ans = i

print(ans)

Solution (Python):
print(1 << len(bin(int(input()))) - 3)

Solution (Python):
n = int(input())

max_count = 0
ans = 1

for i in range(1,n+1):
    count = 0
    tmp = i
    for j in range(1,i+1):
        if tmp % 2 == 0:
            tmp /= 2
            count += 1
        else:
            if count > max_count:
                ans = i
                max_count = count
            break
print(ans)

Solution (Python):
n = int(input())
cnt = 1
while cnt<=n:
    cnt *= 2
print(cnt//2)

Solution (Python):
N = int(input())

lst = list(range(1, N + 1))
counter = 0  

while len(lst) > 1:
    lst = [i // 2 for i in lst if i % 2 == 0]
    counter += 1

print(lst[0] * 2 ** counter)

Solution (Python):
n = int(input())
ans = 1
while 1:
    if (n < ans*2):
        break
    ans *= 2
print(ans)

Solution (Python):
import math
def getInt(): return int(input())

print(2**int(math.log2(getInt())))

Solution (Python):
N = int(input())
for k in range(1,8):
	if(N < 2**k):
		ans = 2**(k-1)
		break
		
print(ans)

Solution (Python):
N = int(input())
print(2**(len(bin(N)[2:])-1))

Solution (Python):
print(2**(len(format(int(input()),"b"))-1))

Solution (Python):
n = int(input())
m = 0
while 2**m <= n:
  m +=1
print(2**(m-1))

Solution (Python):
N = int(input())
if(N == 1):
	answer = 1
else:
	answer = 0
max_count = 0
for val in range(N+1):
    tmp = val
    count = 0
    while (tmp % 2 == 0):
        if(tmp == 0):
            break
        tmp /= 2
        count += 1
    if(max_count < count):
        answer = val
        max_count = count

print(answer)

Solution (Python):
N = int(input())
count = 0
while True:
    c = 2**count
    if c > N:
        print(c//2)
        break
    else:
        count +=1

Solution (Python):
n = int(input())
ct = 0
i =1 
while n >= i*2:
 i = i *2
 ct += 1
print (2**ct)

Solution (Python):

import sys

N = int(input())

cnt = [0 for x in range(N)]
a = [int(_ + 1) for _ in range(N)]

for i in range(N) :
    while True :
        if a[i] % 2 == 0 :
            a[i] = a[i] // 2
            cnt[i] += 1
        else :
            break

print(cnt.index(max(cnt)) + 1)

Solution (Python):
N = int(input())
m = 0
ans = 1
for i in range(N + 1):
    c = 0
    x = i
    while i > 0:
        if i % 2 == 0:
            i = i // 2
            c += 1
        else:
            break
    if m < c:
        m = c
        ans = x
print(ans)

Solution (Python):
print(2**(len(bin(int(input())))-3))

Solution (Python):
n = int(input())
ans = 1
while ans <= n:
    ans *= 2
print(ans//2)

Solution (Python):
N = int(input())

result = 0

for i in range(0, 7):
    if N >= 2**i:
        result = 2**i

print(result)

Solution (Python):
n=int(input())


def kaisu(j):
    kotae=0
    while j % 2==0:
        j = j >> 1
        kotae+=1
    return kotae

kaisu0=0
ans=1
for i in range(1,n+1):
    if kaisu0 < kaisu(i):
        kaisu0 = kaisu(i)
        ans = i

print(ans)

Solution (Python):
n=int(input())


def kaisu(j):
    kotae=0
    while j % 2==0:
        j = j / 2
        kotae+=1
    return kotae

kaisu0=0
ans=1
for i in range(1,n+1):
    if kaisu0 < kaisu(i):
        kaisu0 = kaisu(i)
        ans = i

print(ans)

Solution (Python):
print(2**(len(bin(int(input())))-3))

Solution (Python):
n=int(input())
a=[2**i for i in range(10)]
for i in range(0,len(a)):
    if a[i]>n:
        ans=a[i-1]
        break
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline
N = int(input())
lut = [2, 4, 8, 16, 32, 64]
a = 1
for l in lut:
    if l <= N:
        a = l
print(a)

Solution (Python):
N = int(input())
i = 0
while 2 ** i <= N:
    i += 1
print(pow(2, i-1))

Solution (Python):
import sys

lines = sys.stdin.readlines()

cnt = 1
threshold = int(lines[0].strip())
if threshold == 0:
  print(0)
  sys.exit()

sentinel = 9999
for i in range(sentinel):
  new_cnt = cnt * 2
  if new_cnt > threshold:
    print(cnt)
    break
  else:
    cnt = new_cnt

Solution (Python):
a = int(input())


for i in range(a):
    if(a==1):
        print(1)
        break
    if(2**i>a):
        print(2**(i-1))
        break

Solution (Python):
def abc068_b():
    n = int(input())
    ans = 1
    count = 0

    for i in range(1, n + 1):
        num = i
        tmp_count = 0
        while num % 2 == 0:
            tmp_count += 1
            num /= 2
        if tmp_count > count:
            ans = i
            count = tmp_count

    print(ans)


abc068_b()

Solution (Python):
N = int(input())
C = []
for i in range(1,N+1):
    num = i
    count = 0
    while True:
        if num % 2 == 0:
            num = num / 2
            count += 1
        else:
            break
    C.append(count)
print(C.index(max(C))+1)

Solution (Python):
a = int(input())
s = 1
n = 8
while n>0:
    if 2**n <=a:
        s = 2**n
        break
    n-=1
print(s)

Solution (Python):
N = int(input())

ans = 1
while ans <= N:
    ans *= 2

print(ans // 2)

Solution (Python):
import math
N = int(input())
r = math.floor(math.log2(N))
print(2**r)

Solution (Python):
N = int(input())

cnt = 0
result = {}
x = 1
if(N == 1):
  print(1)
  exit()
else:
  for i in range(1,N+1):
    while i%2 == 0:
      i //= 2
      cnt += 1
      x += 1
      result[x] = cnt
    cnt = 0
print(max(result, key = result.get))

Solution (Python):



def main():
    """Function."""
    n = int(input())

    base = [2**x for x in range(7)]

    max_base = 0
    for dum in base:
        if n >= dum:
            max_base = dum

    print(max_base)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = int(input())
    max_quot = 0
    max_quot_i = 1
    for i in range(1, n + 1):
        quote = 0
        ii = i
        while ii % 2 == 0:
            ii //= 2
            quote += 1
        if quote > max_quot:
            max_quot = quote
            max_quot_i = i
    print(max_quot_i)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
_max = 0
out = 1
for i in range(1, n + 1):
    count = 0
    _i = i
    while _i > 0 and _i % 2 == 0:
        count += 1
        _i = _i // 2
    if count > _max:
        out = i
        _max = max(_max, count)
print(out)

Solution (Python):
N = int(input())
c=0
while N >= 2:
    N = N/2
    c += 1
print(2**c)

Solution (Python):

N = input()
count=0
for i in range(N):
  if N != 1:
    N=N/2
    count+=1
  else: break
print 2**count

Solution (Python):

N = int(input())
x = 1
while N >= 2**x:
  x = x+1
  
print(2 ** x //2)

Solution (Python):
import math
N = int(input())


for i in range(N) :
    if (N == 1) :
        print(1)
        break

    if (N < math.pow(2,i)) :
        print(int(math.pow(2,i-1)))
        break

Solution (Python):
N = int(input())

list_n = [2**i for i in range(7)]
c = 0
for i in list_n:
    if i <= N:
        c=i

print(c)

Solution (Python):
n=int(input())
if n >= 64:
    print("64")
elif n >= 32:
    print("32")
elif n >= 16:
    print("16")
elif n >= 8:
    print("8")
elif n >= 4:
    print("4")
elif n >= 2:
    print("2")
else:
    print("1")

Solution (Python):





def breakNumber(pint):

	numArray = [i for i in range(1,pint+1)]
	i = 0

	while i < pint :
		devCount=0
		while numArray[i] % 2 == 0:
			devCount = devCount+1
			numArray[i] = numArray[i] // 2
		numArray[i] = devCount
		i=i+1

	maxDevLabel = -1
	maxDevNumber = -1
	i = 0
	while i < pint :
		if maxDevNumber < numArray[i] :
			maxDevNumber = numArray[i]
			maxDevLabel = i
		i = i + 1

	answer = maxDevLabel+1
	return answer


if __name__ == '__main__':
	inputNum = int(input())
	ans=breakNumber(inputNum)
	print(ans)

Solution (Python):
def calculate_dived_by_two(n):
    count = 0
    while n % 2 == 0:
        count += 1

        n //= 2

    return count


n = int(input())

result = 1
max_count = 0
for i in range(1, n + 1):
    count = calculate_dived_by_two(i)
    if count > max_count:
        max_count = count
        result = i

print(result)

Solution (Python):
N = int(input())
n = 1
while n <= N:
  n *= 2
     
print(n // 2)

Solution (Python):
N=int(input())
cnt=1
a=2
while a<=N:
    a*=2
    if a<=N:
        cnt+=1
if N==1:
    print(1)
else:
    print(2**cnt)

Solution (Python):
N = input()
print max ([2 ** i for i in range(8) if 2 ** i <= N])

Solution (Python):
import sys
N = input()
for i in reversed(range(7 + 1)):
    if 2 ** i <= N:
        print 2 ** i
        break

Solution (Python):
import sys
N = input()
for i in reversed(range(N + 1)):
    for j in reversed(range(7 + 1)):
        if i== 2 ** j:
            print i
            sys.exit(0)

Solution (Python):
n=int(input())
list=[2**(1*i) for i in range(7)]
ans=1000
sol=0
for i in list:
  if i <= n:
    dis=abs(i-n)
    if dis < ans:
      ans=dis
      sol=i
print(sol)

Solution (Python):
N=int(input())

for i in range(7):
    if(N>=2**i and N<2**(i+1)):
        print(2**i)
        quit()

print("0")

Solution (Python):

N = int(input())

ans = 1
while ans*2 <= N:
    ans*=2
print(ans)

Solution (Python):

N = int(input())
lst = [1,2,4,8,16,32,64]

ans = 1
for i in lst:
    if i > N:
        break
    ans = i
print(ans)

Solution (Python):

N = int(input())

if N == 1:
    print(1)
elif N<=3:
    print(2)
elif 4<=N<=7:
    print(4)
elif 8<=N<=15:
    print(8)
elif 16<=N<=31:
    print(16)
elif 32 <=N<=63:
    print(32)
else:
    print(64)

Solution (Python):
n = int(input())

count = 0
while True:
    if n // 2 == 0:
        break

    n //= 2
    count += 1

result = 2 ** count
print(result)

Solution (Python):
n=int(input())
a=0
c=0
x=0
y=1
for i in range(1,n+1):
  c=0
  a=i
  while True:
    if a%2==0:
      a/=2
      c+=1
    else:
      if x<c:
        x=c
        y=i
      break
print(y)

Solution (Python):
import math;print(2**(int(math.log2(int(input())))))

Solution (Python):
import math
print(2**int(math.log2(int(input()))))

Solution (Python):
N = int(input())
max_div = [1, 0]
for n in range(1, N + 1):
    div = [n, 0]
    while n % 2 == 0:
        n //= 2
        div[1] += 1
    if div[1] > max_div[1]:
        max_div = div
print(max_div[0])

Solution (Python):
n = int(input())
k = 0
count = 0
m = 0
for i in range(1, n + 1):
  count = 0
  j = i
  while j % 2 == 0:
    count += 1
    j = j // 2
  if i == 1:
    k = count
    m = i
  elif k < count:
    k = count
    m = i
print(m)

Solution (Python):
N = int(input())
r = 0
for i in range(1, N+1):
    for n, v in enumerate((2, 4, 8, 16, 32, 64)):
        if i % v == 0:
            r = max(r, n+1)
print(2**r)

Solution (Python):
n = int(input())
if n == 1:
    print(1)
elif 2 <= n <= 3:
    print(2)
elif 4 <= n <= 7:
    print(4)
elif 8 <= n <= 15:
    print(8)
elif 16 <= n <= 31:
    print(16)
elif 32 <= n <= 63:
    print(32)
else:
    print(64)

Solution (Python):
n = int(input())
ans = 2

while ans <= n:
    ans = ans << 1

print(ans>>1)

Solution (Python):
n = int(input())
ans = 64
while ans > n:
    ans = ans // 2
print(ans)

Solution (Python):
n = int(input())
ans = 1

while ans <= n:
    ans *= 2

print(int(ans / 2))

Solution (Python):
N = int(input())
i = 0
while(2 ** i <= N):
  i += 1
print(2 ** (i-1))

Solution (Python):
a = int(input())
b = 0

while a > 0:
  a = int(a / 2)
  b += 1
  
print(2**(b-1))

Solution (Python):
n = int(input())

ans = 1

while ans <= n:
    ans *= 2

print( ans // 2 )

Solution (Python):
N = int(input().rstrip())

i = 1
while True:
    if N < i * 2:
        break

    i *= 2

print(i)

Solution (Python):
N = int(input())
x=0
array=[]
for i in range(N):
    n=i+1
    c=0
    while n%2==0:
        c+=1
        n/=2
    if x<=c:
        array.append(i+1)
        x=c
print(array[-1])

Solution (Python):
n = int(input())
count = 0

for i in range(8):
    if 2**i <= n and n < 2**(i+1):
        print(2**i)
        break

Solution (Python):
N = int(input())
List = []
for i in range(N):
    count = 0
    while i % 2 != 0:
        i = i // 2
        count += 1
    List.append(count)

maxcount = 0
for i in range(N):
    if maxcount <= List[i]:
        maxcount = List[i]
        ans = i+1
print(ans)

Solution (Python):
n = int(input())
print(2 ** (n.bit_length() - 1))

Solution (Python):
N = int(input())
l = list(range(1,N+1))
l_count = []
for e in l:
  count = 0
  while e % 2 == 0:
    e /= 2
    count += 1
  l_count.append(count)
max_index = l_count.index(max(l_count))
print(l[max_index])

Solution (Python):
import math
n = int(input())
print(2**int(math.log2(n)))

Solution (Python):


N = int(input())

l = [i for i in range(1, N + 1)]

max_count = 0
max_number = l[0] 
for number in l:
    n = number
    count = 0
    while (n % 2 == 0):
        n /= 2
        count += 1
    if count > max_count:
        max_count = count
        max_number = number

print(max_number)

Solution (Python):
import math
N = int(input())
ans = int(math.log2(N))
print(2**ans)

Solution (Python):
def f(x, cnt):
    if x % 2 != 0 or x == 0:
        return cnt
    else:
        cnt += 1
        return f(x//2, cnt)

N = int(input())
ans, cnt = 0, 0
for i in range(1, N+1):
    c = f(i, 0)
    if c >= cnt:
        ans, cnt = i, c
print(ans)

Solution (Python):
print(2**(len(bin(int(input())))-3))

Solution (Python):


n=int(input())
i=1
while 2**i <=n:
  i=i+1
i=i-1
print(2**i)

Solution (Python):
n = int(input())

dp = [0]*(n+1)

for i in range(n+1):
    t = i
    while t > 1:
        if(t%2 == 0):
            t = int(t/2)
            dp[i] += 1
        else:
            break

print(dp.index(max(dp))) if max(dp) != 0 else print('1')

Solution (Python):
n=int(input())
for i in range(8):
    if n<2**i:
        print(2**(i-1))
        exit()

Solution (Python):
n=int(input())
if n<2:
    print(1)
elif n<4:
    print(2)
elif n<8:
    print(4)
elif n<16:
    print(8)
elif n<32:
    print(16)
elif n<64:
    print(32)
else:
    print(64)

Solution (Python):
from sys import stdin


def main() -> int:
    n = next_int()
    for i in range(n, 0, -1):
        if judge(i):
            print(i)
            break
    return 0


def judge(n: int) -> bool:
    while n % 2 == 0 and n != 0:
        n //= 2
    if n == 1:
        return True
    return False


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = [1,2,4,8,16,32,64]
b = []
for i in a:
  if i <= n:
    b.append(i)
print(b[-1])

Solution (Python):
n = int(input())
a = [2 ** x for x in range(n) if (2 ** x) <= n]
print(max(a))

Solution (Python):
N = int(input())
ans = 0
for i in range(6+1): 
    if 2**i <= N:
        ans = 2**i
print(ans)

Solution (Python):
n=int(input())
i=0
while 2**i<=n:
    s=2**i
    i+=1
print(s)

Solution (Python):
N = int(input())

res = 1
while True:
    if res * 2 <= N:
        res *= 2
    else:
        break
print(res)

Solution (Python):
n=int(input())
array=[]
for i in range (1,n+1):
    j=i
    count=0
    while(j%2==0):
        j=j/2
        count+=1
    array.append(count)
max=array[0]
for i in  range(n):
    if array[i]>=max:
        max=array[i]
        j=i
print(j+1)

Solution (Python):
import math
N = int(input())
n = int(math.log2(N))
ans = pow(2,n)
print(ans)

Solution (Python):
n = int(input())

ans = 0
count = 0
best = 0

for i in range(n, 0, -1):
    count = 0
    x = i
    while True:
        if x % 2 == 0:
            count += 1
            x = x / 2
        else:
            break
    if count > best:
        best = count
        ans = i
        
if ans == 0:
    ans = 1

print(ans)

Solution (Python):
def two_count(num):
    count = 0
    while num % 2 == 0:
        count += 1
        num //= 2
    return count

n = int(input())

n_two_count = [two_count(n_i) for n_i in range(1, n+1)]
print(n_two_count.index(max(n_two_count))+1)

Solution (Python):
N = int(input())
ans = 1
bai2 = [2**i for i in range(0, 7)]

for i in bai2:
    if i<=N:
        ans = i
print(ans)

Solution (Python):
from math import log2
n = int(input())
print(2**int(log2(n)))

Solution (Python):
N = int(input())
num = 0
ans = 1
for i in range(2, N + 1, 2):
    k = i
    rec = 0
    while k > 0:
        k //= 2
        rec += 1
    if rec > num:
        num = rec
        ans = i

print(ans)

Solution (Python):
n = int(input())
ct = 0
max_ct = 0
now = 0
max_num = 1
for i in range(1, n+1):
    now = i
    while (i % 2 == 0):
        i = i / 2
        ct += 1
    if max_ct < ct:
        max_ct = ct
        max_num = now
    ct = 0

print(max_num)

Solution (Python):
import math

N = int(input())

M = math.floor(math.log2(N))

print(2**M)

Solution (Python):
N = int(input())
count = 0
while N >= 2**count:
  count += 1

print(2**(count - 1))

Solution (Python):
n = int(input())

sisuu = 0
while True:
	if 2 ** (sisuu + 1) > n :
		break
	sisuu += 1

print(2 ** sisuu)

Solution (Python):
n = int(input())

index =0
while True:
    if 2**index > n:
        break
    index+=1

print(2**(index-1))

Solution (Python):
l = bin(int(input()))
s = len(l)-3
print(pow(2, s))

Solution (Python):
num=int(input())
max=0
maxnum=1
for ii in range(num):
    i=ii+1
    div=0
    while True:
        if i%2==0:
            i//=2
            div+=1
        else:
            break
    if(div>max):
        max=div
        maxnum=ii+1
print(maxnum)

Solution (Python):
n = int(input())

c = []

for i in range(n):
    now = 0
    for j in range(i + 1):
        now = 0
        k = j + 1
        while k % 2 == 0:
            now += 1
            k -= k // 2
            
    c.append(now)





print(max(range(len(c)), key = lambda i: c[i]) + 1)

Solution (Python):
n=int(input())
res=0
for i in range(1,8):
    if n < 2**i:
        res = 2**(i-1)
        break
print(res)

Solution (Python):
n = int(input())
list_2 = []
for i in range(0, 8):
    list_2.append(2 ** i)
count = 0
while True:
    if n >= list_2[count]:
        count += 1
        continue
    else:
        print(list_2[count-1])
        break

Solution (Python):
N = int(input())
num = 1
while num<=N:
  num*=2
print(num//2)

Solution (Python):
n=int(input())
for i in range(100):
    if(2**i>n):
        print(2**(i-1))
        exit()

Solution (Python):
n = int(input())

ans = 0
num = 1
for i in range(1, n+1):
    count = 0
    while i % 2 == 0:
        i = i // 2
        count += 1
    if ans < count:
        ans = count
        num = i

print(num * 2 ** ans)

Solution (Python):
import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()

ans = 1
temp = 0
res = 0
for i in range(1,n+1):
    m = i
    temp = 0
    while m % 2 == 0:
        m //= 2
        temp += 1

    if temp > res:
        res = temp
        ans = i
    
print(ans)

Solution (Python):
N = int(input())
k = len(bin(N))-3
print(2**k)

Solution (Python):
n = int(input())
i = 0
while True:
  if 2**i <= n:
    pre = 2**i
    i += 1
  else:
    ans = pre
    break
print(ans)

Solution (Python):
print(2**(len(bin(int(input())))-3))

Solution (Python):
import bisect
N=int(input())
A=[1,2,4,8,16,32,64,101]
a=bisect.bisect_left(A,N)
print(A[a if A[a]==N else a-1])

Solution (Python):
import bisect
N=int(input())
A=[1,2,4,8,16,32,64,101]
a = bisect.bisect_left(A,N)
print(A[a if A[a]==N else a-1])

Solution (Python):
N = int(input())
if N >= 64 :
    print(64)
elif N >= 32 :
    print(32)
elif N >= 16 :
    print(16)
elif N >= 8 :
    print(8)
elif N >= 4 :
    print(4)
elif N >= 2 :
    print(2)
else :
    print(1)

Solution (Python):
N = int(input())

x = 1
while x <= N:
    x *= 2
print(x // 2)

Solution (Python):
N = int(input())
flag = False
for i in range(N):
  if(2**i <= N < 2**(i+1)):
    flag = True
    break
print(2**i)

Solution (Python):
n=int(input())
for x in range(8):
 if 2**(x-1)<=n<2**x:print(2**(x-1))

Solution (Python):
n=int(input())
if n<2:print(1)
elif n<4:print(2)
elif n<8:print(4)
elif n<16:print(8)
elif n<32:print(16)
elif n<64:print(32)
else:print(64)

Solution (Python):
N = int(input())

ans = 1
ind = 0

for i in range(1,N+1):
    num = 0
    tmp = i
    while tmp%2 == 0:
        tmp = tmp//2
        num += 1
    if ind < num:
        ind = num
        ans = i
print(ans)

Solution (Python):
N = int(input())
a = [1]
A = 1
while True:
    A *= 2
    if A > N:
        break
    a.append(A)
print(a[-1])

Solution (Python):
n = input()
ans = 0
while n!= 0:
	ans += 1
	n//=2
print 1 << (ans-1)

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    N = int(input())
    ans = 0
    for i in range(10):
        if 2 ** i <= N:
            ans = 2 ** i
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
num=1
while num<=N:
    num*=2
print(num//2)

Solution (Python):
N = int(input())
num = 1

for i in range(1, 9):
    if 2**i <= N:
        num = 2**i
print(num)

Solution (Python):
N=int(input())
a=[0]
i=0
if N==1:
    print(1)
    exit()
while a[-1]<=100:
    a.append(2**i)
    i+=1
for i in range(1,len(a)):
    if a[i]>N:
        print(a[i-1])
        exit()

Solution (Python):
print(2**(len(bin(int(input())))-3))

Solution (Python):
N = int(input())

ans = 1
while N > 1:
  N = N // 2
  ans = ans * 2

print(ans)

Solution (Python):
n = int(input())

for i in range(n, 0, -1):
    if i&(i-1) == 0:
        print(i)
        break

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return




dp = None


def main():
    N = int(input())

    ans = 0
    while 2**ans <= N:
        ans += 1

    print(2**(ans - 1))


main()

Solution (Python):
def count_div(num):
    res = 0
    while num % 2 == 0:
        num //= 2
        res += 1
    return res

n = int(input())

ans = 1
max_cnt = 0
if n >= 2:
    for i in range(2, n+1, 2):
        cnt = count_div(i)
        if cnt > max_cnt:
            max_cnt = cnt
            ans = i

print(ans)

Solution (Python):
n=int(input())
i=1
while i*2<=n:i*=2
print(i)

Solution (Python):
N = int(input())
for i in range(8):
    if 2**i > N:
        break
print(2**(i-1))

Solution (Python):
n = int(input())
i = 0
while 2 ** i <= n:
    i += 1
print(2 ** (i - 1))

Solution (Python):
N=int(input())
if N<2:
    print(1)
elif N<4:
    print(2)
elif N<8:
    print(4)
elif N<16:
    print(8)
elif N<32:
    print(16)
elif N<64:
    print(32)  
elif N<= 100:
    print (64)

Solution (Python):

n = int(input())
a=1
while a <= n:
    a*=2
print(a//2)

Solution (Python):
s = raw_input()
n = int(s)
dp = [0 for _ in range(n+1)]
dp[0] = 0
dp[1] = 1
maxl, num = 1, 1
for i in range(2, n+1):
    if i % 2 == 1:
        dp[i] = 0
    else:
        dp[i] = dp[i/2] + 1
        if dp[i] > maxl:
            maxl = dp[i]
            num = i
print num

Solution (Python):
a = [64, 32, 16, 8, 4, 2, 1]
n = int(input())
for i in a:
  if i <= n:
    print(i)
    exit()

Solution (Python):
n, a = int(raw_input()), 2
while a <= n:
    a <<= 1
print a >> 1

Solution (Python):
n, a = int(raw_input()), 2
while a <= n:
    a <<= 1
print a >> 1

Solution (Python):
N = int(input())
ans = 1
while ans <= N:
	ans *= 2
print(ans//2)