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):
a = int(input())
if a<2:print(1)
elif a<4:print(2)
elif a<8:print(4)
elif a<16:print(8) 
elif a<32:print(16)
elif a<64:print(32)
else:print(64)

Solution (Python):

n = int(input())
print(max([s for s in [1, 2, 4, 8, 16, 32, 64] if s <= n]))

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

i = 1

while i*2 <= n:
    i *= 2
    
print(i)

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

if N == 1:
    print(N)
elif N >= 2 and 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())
List=[1,2,4,8,16,32,64]
if (n==1):
  print(List[0])
elif (2<=n<4):
  print(List[1])
elif (4<=n<8):
  print(List[2])
elif (8<=n<16):
  print(List[3])
elif (16<=n<32):
  print(List[4])
elif (32<=n<64):
  print(List[5])
else:
  print(List[6])

Solution (Python):
print(sorted(range(1,int(input())+1),key=lambda x:x&(-x))[-1])

Solution (Python):












N = int(input())

i = 2
if N==1:
    ans=1
else:
    while not i>N:
        ans = i
        i = i*2

print(ans)

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

Solution (Python):
n=int(input().rstrip())
i=0
while 1:
  num=2**i
  if num==n or num*2 > n:  
    break
  i+=1
print(num)

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

Solution (Python):
a=int(input())
b=0
for i in range(7):
  if 2**i<=a:
    b=2**i
print(b)

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

Solution (Python):
N = int(input())
k = 0
while True:
  if 2**k <= N < 2**(k+1):
    print(2**k)
    break
  k += 1

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

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

ans = 1 
top_count = -1
for i in range(2, N + 1):
    temp = i
    count = 0
    while temp % 2 == 0:
        count += 1
        temp = temp / 2
    if top_count < count:
        ans = i
        top_count = count

print(ans)

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

def cal(n):
    cnt = 0
    while n % 2 == 0:
        n = n//2
        cnt += 1
    return cnt

ans = -1
for i in range(N,0,-1):
    if ans < cal(i):
        ans = cal(i)
        ans_n = i
print(ans_n)

Solution (Python):
import bisect
n=int(input())
for i in range(7):
  if 2**i<=n:
    ans=2**i
print(ans)

Solution (Python):
n = int(input())
box  = []
prime = []
ans = 0
def Prime_Factorization(n):
    i = 2
    prime_factors = []
    while n > 1:
        if n % i == 0:
            prime_factors.append(i)
            n = n / i
        else:
            i += 1
    return prime_factors

for i in range(1,n+1):
    prime = Prime_Factorization(i)
    box.append(prime.count(2))
    


if n == 1:
    print(1)
else:
    ans = box.index(max(box)) + 1
    print(ans)

Solution (Python):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math


n = int(input())
li = []
for i in range(8):
    li.append(2**i)

for i in range(1,len(li)):
    if li[i-1] <= n and n < li[i]:
        break
print(li[i-1])

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

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

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

for i in range(N):
    if 2 ** (i+1) > N:
        print(2**i)
        break

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

b = 0

while True:
    if N >= 2:
        N /= 2
        b += 1
    if N < 2:
        break

print(2 ** b)

Solution (Python):
N = int(input())
ans = 1
for i in range(7):
    if N >= 2**i:
        ans = 2**i
print(ans)

Solution (Python):
N = int(input())
ans = 1
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)
elif 64<=N<=100:
    print(64)

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

Solution (Python):
n = int(input())
sample = [i+1 for i in range(n)][::-1]

hoge = [1, 2 ,4, 8, 16, 32, 64][::-1]
add = []

flag = False
for h in hoge:
    for s in sample:
        if s % h == 0:
            print(s)
            flag = True
            break
    if flag:
        break

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

ans = 1
n = 0
while True:
    if ans * 2 > N:
        print(ans)
        exit()
    else:
        ans *= 2

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

Solution (Python):


N = int(input())
binaries = [2,4,8,16,32,64]
ans = 1
for i in binaries:
    if N>=i:
        ans=i
print(ans)

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

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

ans = 1
for i in range(1, 8):
    if 2 ** i == N:
        print((2) ** i)
        break
    elif 2 ** i > N:
        print(2 ** (i-1))
        break

Solution (Python):
n = int(input())
t = [-1,-1]
for i in range(1,n+1):
    tn = i
    x=0
    while(i%2 == 0):
        x+=1
        i=i/2
    if t[1] < x:
        t[0],t[1] = tn,x 
print(t[0])

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

s = 1
while s <= n:
    s = s*2
    
s = s//2

print(s)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	n=II()
	ans = 1
	while n >= ans:
		ans *= 2
	print(ans//2)

if __name__ == '__main__':
	main()

Solution (Python):
n = range(1,int(input())+1)

def calc_div(n):
    cnt = 0
    while n/2 !=0:
        cnt += 1
        if n%2 != 1:
            n = n/2
        else:
            break
    return cnt

list = []
for i in n:
    j = calc_div(i)
    list.append(j)

max_value = max(list)
max_index = list.index(max_value)
print(n[max_index])

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

e = 1
cnt = 0
while(e < N):
    if e*2 > N:
        break
    e *= 2
    cnt += 1

print(e)

Solution (Python):
n = int(input())
ans = 1
ma_div = 0
divs = [1, 2, 4, 8, 16, 32, 64,128]
for i in range(1, n + 1):
    for j, div in enumerate(divs):
        if i % div != 0:
            break
    if j > ma_div:
        ans = i
        ma_div = j
print(ans)

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

while True:
    if ans * 2 > n:
        break
    ans *= 2
print(ans)

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

Ans=0
Ans2=0
Count2=0
for i in range(1,N+1):
    Ans=i
    Count=0
    for j in range(N):
        if i%2==0:
            Count+=1
            i=i//2
        else:
            break
    if Count>Count2:
        Ans2=Ans
        Count2=Count
    
print(Ans2 if Ans2>0 else 1)

Solution (Python):
n = int(input())
r_list = [0] * n
for i in range(1, n+1):
	t = i
	while True:
		if t % 2 != 0:
			break
		else:
			t = t // 2
			r_list[i-1] += 1
max_r = max(r_list)
r_list.reverse()
n_list = [i for i in range(1, n+1)]
n_list.reverse()
r = 0
for i, v in enumerate(r_list):
	if v == max_r:
		r = n_list[i]
print(r)

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

ans = 1
judg = 0


for i in range(N):
    x = i+1
    counter = 0
    while True:
        if x%2==0:
            x = x / 2
            counter += 1
        else:
            break
    if judg<counter:
        ans = i+1
        judg = counter


print(ans)

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())
i = 1
for i in range(1, 7+1):
  if pow(2, i) > N:
    print(pow(2, i - 1))
    exit()

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

Solution (Python):
def myAnswer(N:int) -> int:
   lis = [i for i in range(1,N+1)]
   MAX = 0
   ans = 0
   for l in lis:
      counter = 0
      tmp = l
      while l != 0:
         l = l//2
         counter+=1
      if(MAX < counter):
         MAX = counter
         ans = tmp
   return ans


   

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   print(myAnswer(N))

if __name__ == '__main__':
   main()

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

i = 0
while 2 ** i <= N:
    i += 1
print(2 ** (i - 1))

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

Solution (Python):
import numpy as np
N = int(input())
print(2 ** int(np.log2(N)))

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

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

for i in range(n):
    if 2 * ans > n:
        print(ans)
        break
    else:
        ans *= 2

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

Solution (Python):
import sys
n = int(input())
ans = 1
for i in range(10):
    ans = 2**i
    if  ans >n:
        print(2 ** (i- 1))
        sys.exit()

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

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

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

i = 1
while(1):
    if i*2 > N:
        break
    i = i*2
print(i)

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

if N-2**n<2**n:
    print(2**n)

Solution (Python):
n=int(input())
x=1
while True:
  if x<n:
    x=x*2
  else:break
if x>n :
  print(x//2)
else:print(x)

Solution (Python):
N = int(input())
a = 1
for i in range(7):
    if N >= 2**i:
        a = 2**i
print(a)

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

count=0
while n>1:
    n=n//2
    count+=1
    
print(2**count)

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

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

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

while ans <= n:
    ans *= 2
print(ans//2)

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

ans = 1
max_num = 0

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

print(ans)

Solution (Python):
n = int(input())
ans = 1
acnt = 0
for i in range(1,n+1):
  tmp = i
  cnt = 0
  while tmp > 0:
    cnt += 1
    tmp //= 2
  if acnt < cnt:
    acnt = cnt
    ans = i
print(ans)

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

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

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

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

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

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

print(k)

Solution (Python):
n=int(input())
if n>=64:
    print(64)
elif 64>n and n>=32:
    print(32)
elif 32>n and n>=16:
    print(16)
elif 16>n and n>=8:
    print(8)
elif 8>n and n>=4:
    print(4)
elif 4>n and n>=2:
    print(2)
else:
    print(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):
l = [1, 2, 4, 8, 16, 32, 64]
n = int(input())
if n in l:
    l.append(n)
    l.sort()
    print(l[l.index(n)])
else:
    l.append(n)
    l.sort()
    print(l[l.index(n)-1])

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

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

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

Solution (Python):




"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""








def main():
  n = int(input())
  ma_ = 1
  while n != 1:
    p = n
    cnt = 0
    while p != 1:
      if p % 2 == 0:
        cnt += 1
        p //= 2
      else:
        p = 1
    ma_ = max(ma_,2**cnt)
    n -= 1
  print(ma_)
if __name__ == '__main__':
  main()

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

Solution (Python):
n = int(input())
for i in range(7):
    if 2**i <= n < 2**(i+1):
        print(2**i)
    else:
        pass

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

for i in range(n+1):
    new = 0
    while i % 2 == 0 and i != 0:
        new += 1
        i /= 2
    if new > count:
        count = new
print(2**count)

Solution (Python):
N = int(input())
 
for i in range(7):
    if 2**i <= N:
        s = i
        
print(2**s)

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

for i in range(7):
    if 2**i <= N:
        s = i
        
print(2**s)

Solution (Python):
n = int(input().strip())
if n == 1:
    print(1)
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 <= 100:
    print(64)

Solution (Python):


N = int(input())

ans_cou = 0
ans_num = 1
for i in range(N + 1):
    a = i
    sum = 0
    while a % 2 == 0 and a != 0:
        sum += 1
        a = a // 2
    if sum > ans_cou:
        ans_cou = sum
        ans_num = i

print(ans_num)

Solution (Python):

import math
import itertools
import statistics

import collections



n = int(input())
m = 0
max_idx = -1
for i in range(1, n+1):
    n = i
    count = 0
    while n==n//1:
        n /= 2
        count += 1
    
    if count >= m:
        m = count
        max_idx = i
    


print(max_idx)

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):
import sys

N = int(input())

def solve(i):
    if i % 2 != 0:
        return 0
    else:
        return 1 + solve(i // 2)

if N == 1:
    print(1)
    sys.exit()

box = []
for k in range(1, N+1):
    box.append(solve(k))
mb = max(box)
for i in range(1, N+1):
    if box[i] == mb:
        print(i+1)
        break

Solution (Python):

import sys
import itertools
import fractions
import copy
import bisect
import math

from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter


N=3
M=3
i=0
j=0
k=0
n=3
r=1
a=[0]*5
b=[]
N=int(input())
real=math.sqrt(N)


intb=math.floor(real)
for i in range(100):
    if N < 2**i:
        if i==0:
            print(N)
            sys.exit()
        print(2**(i-1))
        sys.exit()




"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

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

Solution (Python):
n=int(input())
for i in range(7):
    if 2**i<=n<2**(i+1):print(2**i)
    else:pass

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

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

Solution (Python):
N = int(input())
if 2**6<= N:
    print(2**6)
elif 2**5<= N <2**6:
    print(2**5)
elif 2**4<= N <2**5:
    print(2**4)
elif 2**3<= N <2**4:
    print(2**3)
elif 2**2 <= N < 2**3:
    print(2**2)
elif 2**1 <= N < 2**2:
    print(2**1)
else:
    print(1)

Solution (Python):
N = int(input())
s = [0,1,2,4,8,16,32,64,128]
for x in range(len(s)-1):
  if N in range(s[x],s[x+1]):
    print(s[x])

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

for i in range(1, n + 1):
    anstmp = 0
    test = i
    while test % 2 == 0:
        test = test / 2
        anstmp = anstmp + 1

    if num <= anstmp:
        ans = i
        num = anstmp

print(ans)

Solution (Python):
def f(n):
  ret=0
  while n%2==0:
    ret+=1
    n/=2
  return ret
n=int(input())
ans=0
max_=0
for a in range(1,n+1):
  if f(a)>=max_:
    max_=f(a)
    ans=a
print(ans)

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

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

tmp = [1,2,4,8,16,32,64]

ans = max([i for i in tmp if i <= n])
print(ans)

Solution (Python):
n=int(input())
x=1
while True:
  if x<n:
    x=x*2
  else:break
if x>n :
  print(x//2)
else:print(x)

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

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

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

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

a=1
for i in range(7):
    a=a*2
    if a>N:
        a=a//2
        break;
print(a)

Solution (Python):
N = int(input())
y = 0
for i in range(1,N+1):
  x = 0
  while i%2 <= 0:
    i = i/2
    x = x+1
  if y < x:
    y = x

print(2**y)

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

now=1
while True:
  if now>n:
    break
  now*=2
print(now//2)

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

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

Solution (Python):
N = int(input())
max = 0
ans = 1

for i in reversed(range(0, N+1)):
  if i % 2 == 0:
    tmp = i
    cnt = 0
    for _ in range(N):
      if i % 2 == 0 and i != 0:
        i = i // 2
        cnt += 1
    if max < cnt:
      max = cnt
      ans = tmp
        
print(ans)

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

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

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

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

Solution (Python):

N = int(input())
for x in range(7):
    if 2**x <= N < 2**(x+1):
        print(2**x)
        break

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

Solution (Python):
n=int(input())
ans=1
cnt=0
for i in range(1,n+1):
    j=i
    cur=0
    while j%2==0:
        j/=2
        cur+=1
    if cur>cnt:
        cnt=cur
        ans=i
print(ans)

Solution (Python):
n = int(input().strip())
if n == 1:
    print(1)
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 <= 100:
    print(64)

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

s2 = 2
c2 = 0
while True:
  if s2*2>N:
    break
  s2 *= 2
  c2 += 1

if N == 1:
  print(1)
else:
  print(2*2**c2)

Solution (Python):
n=int(input())
ans=[1,2,4,8,16,32,64,128]

for i in range(8):
    if ans[i]>n:
        print(ans[i-1])
        exit()

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

Solution (Python):

n=int(input())

a=[]

for nn in range(n):
    if (2**nn) <=n:
        a.append (2**nn) 

print(max(a))

Solution (Python):
N = int(input())
min = 0
max = 0

for i in range(N):
    if 2**i <= N:
        min = 2**i
    else:
        break

print(min)

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

for i in range(10):
  if 2**i <=N:
    maxi=max(maxi,2**i)
    
print(maxi)

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

a = [2**i for i in range(7)]
b = []
for i in a:
  if i <= n:
    b.append(i)
    
print(max(b))

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

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

if n==1:
    print(1)
    exit()
else:
    ans = 1
    while ans<=n:
        ans *= 2

print(ans//2)

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

ans = 1
for i in range(1,10):
    if 2 ** i <= n:
        ans = 2**i

print(ans)

Solution (Python):
N = int(input())
C = -1
while N:
    N //= 2;
    C += 1
print(1 << C)

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

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

for i in range(1,N+1):
  count = 0
  while i%2==0:
    i=i//2
    count+=1
  ans.append(count)

answer=ans.index(max(ans))
print(answer+1)

Solution (Python):
import sys
import math










mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    n = int(input())
    ans = [0,1]
    for i in range(2,n+1):
        x = i
        cnt = 0
        while x%2==0:
            x //= 2
            cnt += 1
        if cnt>ans[0]:
            ans[0] = cnt
            ans[1] = i
    print(ans[1])
    return

if __name__=='__main__':
    main()

Solution (Python):
n=int(input())
ans=0
for i in (64,32,16,8,4,2,1):
    if i <=n:
        print(i)
        break

Solution (Python):
N = int(input())
ans = list()
for i in range(1, N+1):
  count = 0
  while i%2 == 0:
    i /= 2
    count += 1
  ans.append(count)

A = ans.index(max(ans))
print(A+1)

Solution (Python):
N=int(input())
for i in (64,32,16,8,4,2,1):
    if i <= N:
        print(i)
        break

Solution (Python):
n = int(input())
a = [0 for i in range(n)]

for i in range(1, n + 1):
    num = i
    while num % 2 == 0:
        num /= 2
        a[i - 1] += 1

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

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

for i in range(N, 0, -1):
    if math.log2(i) == int(math.log2(i)):
        output = i
        break
        
print(output)

Solution (Python):
import sys

n = int(input())

div_max = 0
div = 1

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

print("{}".format(div))

Solution (Python):
n=int(input())
b=bin(n)
s=str(b)[2:]
i=len(s)
print(2**(i-1))


'''
i=1
while (i*2<=n):
    i*=2
print(i)
'''

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

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

i = 1
while True:
  i *= 2
  if i > n:
    print(i // 2)
    break

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

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

ans = 1
for i in range(1,10):
    if 2 ** i <= n:
        ans = 2**i

print(ans)

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

Solution (Python):

import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int):
    print(1 << (N.bit_length() - 1))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
times = [0 for i in range(n)]
for i in range(1,n+1):
    result = i
    while result%2 == 0:
        result = result/2
        times[i-1] += 1
print(times.index(max(times))+1)

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

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

Solution (Python):
N = int(input())
ans = 2
for i in range(100):
  if ans > N:
    ans //= 2
    break
  ans *= 2
print(ans)

Solution (Python):








def resolve():
    N=int(input())
    val=1
    while val<=N:
        val=val*2
    print(val//2)

resolve()

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

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

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

print(2**count)

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

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

Solution (Python):
n = int(input())
if n == 1:
  print('1')
else:
  for i in range(n):
    if 2**i <= n and 2**(i+1) > n:
      print(2**i)
      break

Solution (Python):
n = int(input())
counter = 0
cnt = [0]*(n+1)
for i in range(1,n+1):
    j = i
    while(j%2 == 0):
        j = j/2
        counter += 1
    cnt[i] = counter
    counter = 0
max_val = max(cnt[1:])
ans = cnt[1:].index(max_val)
print(ans+1)

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

Solution (Python):
n=int(input())
result = 1
for i in range(n):
  a = n-i
  while a % 2 == 0:
    a /= 2
    if a == 1:
      result = n-i
      break
  else:
    continue
  break
  
  

print(result)

Solution (Python):
n=int(input())
result = 0
for i in range(n):
  a = n-i
  while a % 2 == 0:
    a /= 2
    if a == 1:
      result = n-i
      break
  else:
    continue
  break
  
  
if n == 1:
  print(1)
else:
  print(result)

Solution (Python):
import sys

n=int(input())
if n==1:
  print(1)
  sys.exit()
result = 0
for i in range(n):
  a = n-i
  while True:
    if a % 2 == 1:
      break
    else:
      if a == 2:
        print(n-i)
        sys.exit()
      else:
        a /= 2

Solution (Python):
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.readline().rstrip())
    ret = 0
    for n in range(N):
        tmp = 2 ** n
        if ret < tmp and tmp <= N:
            ret = tmp

    print(ret)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
cnt = 0
ans = 1
for i in range(1,n+1):
    tmp = 0
    while i % 2 == 0:
        tmp += 1
        i //= 2
    if cnt < tmp:
        cnt = tmp
        ans = i * 2 ** tmp
print(ans)

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

Solution (Python):
print(1<<len(bin(int(input())))-(3645747678536676837529748782678*0+3))

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

def main():
  N = int(input())
  ans = 1
  maxv = 0
  for i in range(1, N + 1):
    tmp = count_two(i)
    if tmp > maxv:
      maxv = tmp
      ans = i
  print(str(ans))
    
if __name__ == '__main__':
  main()

Solution (Python):

n=int(input())
maxnum=0
maxtrial=2
while maxtrial<=n:
    maxtrial*=2
print(int(maxtrial/2))

Solution (Python):
N=int(input())
max_num=[0,0]
pass_time=0
for i in range(1,N+1):
  num=0
  init_i=i
  while i%2==0:
    i=i/2
    num+=1
  
  if num>max_num[1]:
    max_num[0]=init_i
    max_num[1]=num
    pass_time+=1
if pass_time==0:
  max_num[0]=init_i
print(max_num[0])

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

maxx=0
maxn=1
for i in range(1,n+1):
  tmp=i
  cnt=0
  while 1:
    if tmp%2==0:
      tmp=tmp//2
      cnt+=1
    else:
      break
  if cnt > maxx:
    maxn=i
    maxx=cnt

print(maxn)

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

Solution (Python):
n=int(input())
ans=1
for i in range(7):
    if 2**i <= n:
        ans=2**i
print(ans)

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

Solution (Python):
import sys

a = [1, 2, 4, 8, 16, 32, 64, 128]
n = int(sys.stdin.readline())

for x in a:
    if n < x:
        break
print(x // 2)