Problem:
 Score : 200 points    Problem Statement Square1001 has seen an electric bulletin board displaying the integer 1 .
He can perform the following operations A and B to change this value:   Operation A: The displayed value is doubled.  Operation B: The displayed value increases by K .   Square1001 needs to perform these operations N times in total.
Find the minimum possible value displayed in the board after N operations.      Constraints  1 \leq N, K \leq 10  All input values are integers.         Input Input is given from Standard Input in the following format:  N  K       Output Print the minimum possible value displayed in the board after N operations.        Sample Input 1 4
3      Sample Output 1 10  The value will be minimized when the operations are performed in the following order: A, A, B, B. In this case, the value will change as follows: 1 → 2 → 4 → 7 → 10 .       Sample Input 2 10
10      Sample Output 2 76  The value will be minimized when the operations are performed in the following order: A, A, A, A, B, B, B, B, B, B. In this case, the value will change as follows: 1 → 2 → 4 → 8 → 16 → 26 → 36 → 46 → 56 → 66 → 76 .  By the way, this contest is AtCoder Beginner Contest 076.

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    k = int(input().rstrip('\n'))
    t = 1
    for _ in range(n):
        if t >= k:
            t += k
        else:
            t *= 2
    print(t)


if __name__ == '__main__':
    slove()

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

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

res = 1

for _ in range(n):
    res += min(res, k)

print(res)

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

a = 1
for i in range(n):
  if a > k:
    a += k
  else:
    a *= 2
print(a)

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

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

now = 1
for _ in range(n):
    now = min(now*2, now+k)
print(now)

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

total=1
for i in range(n):
    if total*2 <= total+k:
        total =total*2
    else:
        total +=k
        
print(total)

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

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n): ans=min(ans*2,ans+k)
print(ans)

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

def dfs(rank, now):
  if rank == N:
    return now
  return min(dfs(rank+1, now*2), dfs(rank+1, now+K))

print(dfs(0,1))

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for i in range(N):
  ans = min(ans*2, ans+K)
print(ans)

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

Solution (Python):
N = int(input())
K = int(input())
M = 1
for _ in range(N):
    M = min(M+K,M*2)
print(M)

Solution (Python):
N = int(input())
K = int(input())
res = 1  
for i in range(res, N+1):
    if res*2 >= res+K:
        res = res+K
    else:
        res = res*2
print(res)

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

ans = 1
for _ in range(n):
    ans = min(ans*2, ans+k)
print(ans)

Solution (Python):
n=int(input())
k=int(input())
c=1
for i in range(n):
    c+=min(c,k)
print(c)

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

ans=1

for i in range(N):
    if ans<K:
        ans=ans*2
    else:
        ans+=K

print(ans)

Solution (Python):
N,K = (int(input()) for _ in range(2))
ans = 1
for i in range(N):
  if ans < K:
    ans *= 2
  else:
    ans += K
print(ans)

Solution (Python):
n = int(input())
k = int(input())
dp = [[0,0] for i in range(n+1)]
dp[0] = [1,1]

for i in range(1,n+1):
    dp[i][0] = min(dp[i-1][0],dp[i-1][1])*2
    dp[i][1] = min(dp[i-1][0],dp[i-1][1])+k
print(min(dp[n]))

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

ans = 1

for _ in range(n):
    ans = min(ans*2, ans+k)

print(ans)

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

ans = 1

for _ in range(n):
    if ans <= k:
        ans *= 2
    else:
        ans += k

print(ans)

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


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

    ans = float('inf')
    for i in range(2**N):
        num = 1
        for j in range(N):
            if (i>>j)&1:
                num *= 2
            else:
                num += K
        ans = min(ans, num)
    
    print(ans)
                


if __name__ == '__main__':
    main()

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

ans = 1
for _ in range(n):
    if ans * 2 <= ans + k:
        ans *= 2
    else:
        ans += k
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 1

for i in range(N):
    if ans < K:
        ans *= 2
    else:
        ans += K * (N - i)
        break

print(ans)

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

x=1
for i in range(n):
    x=min(x*2,x+k)
print(x)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for _ in range(n):
  if ans>k:
    ans += k
  else:
    ans *= 2
print(ans)

Solution (Python):
N = int(input())
K = int(input())
candidates = [1]
for i in range(N):
    new_candidates = []
    for c in candidates:
        new_candidates.append(c * 2)
        new_candidates.append(c + K)
    candidates = new_candidates
    
print(min(candidates))

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

ans = 1
for i in range(n):
  ans = min(ans*2, ans+k)
print(ans)

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

M=[0]*(N+1)
M[0]=1

for i in range(1,N+1):
  M[i]=min(M[i-1]*2,M[i-1]+K)
print(M[N])

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

ans=10**10
for i in range(2**N):
  tmp=1
  for j in range(N):
    if (i>>(N-j-1)&1)==1:
      tmp*=2
    else:
      tmp+=K
  ans=min(ans,tmp)
print(ans)

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

result = 1
for i in range(N):
    result = min(result * 2, result + K)

print(result)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
    if ans>=k:
        ans+=k
    else:
        ans+=ans
print(ans)

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

ans = 1

for i in range(n):
  ans = min(2*ans, ans + k)
  
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ls = []
for i in range(n + 1):
    ls.append(2**i + (n - i) * k)
print(min(ls))

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

cnt = 1

for i in range(N):
    cnt+=(min(cnt, K))

print(cnt)

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

ans = 1
for i in range(N):
    if ans*2 < ans + K:
        ans *= 2
    else:
        ans += K
print(ans)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
    ans=min(2*ans,ans+k)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
  ans = min(ans * 2, ans + k)
print(ans)

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

tmp = 1

for i in range(N):
  if tmp > K:
    tmp += K
  else:
    tmp *= 2
    
print(tmp)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for _ in range(n):
    ans = min(ans*2,ans+k)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
now = 1
for _ in range(N):
    now = min(now*2,now+K)
print(now)

Solution (Python):
n,k = [int(input()) for i in range(2)]
m = 1
for i in range(n):
    m = min(m*2,m+k)
print(m)

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

ans = 1
for _ in range(n):
    ans = min(ans * 2, ans + k)

print(ans)

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

Solution (Python):
N=int(input())
K=int(input())
ans=1
for _ in range(N):
    ans=min(ans*2,ans+K)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
val = 1
for i in range(N):
    if val < K:
        val *= 2
    else:
        val += K
print(val)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for _ in range(N):
    if ans * 2 < ans + K:
        ans *= 2
    else:
        ans += K
print(ans)

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

op=[[0],[1]]

for i in range(n-1):
    tmp=[]
    for j in op:
        tmp.append(j+[0])
        tmp.append(j+[1])
    op=tmp
ans=1e10

for i in op:
    a=1
    for j in range(n):
        if i[j]==0:
            a+=k
        else:
            a*=2
    ans=min(ans,a)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for i in range(N):
    ans = min(ans+K, ans*2)
print(ans)

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""


N =  int(sys.stdin.readline())
K =  int(sys.stdin.readline())

ans = 1
for _ in range(N):
    ans = min(ans * 2, ans + K)
print(ans)

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

max = 0
maxcounter = 0
j = 1

for i in range(N):
  
  
  if j * 2 <= j + R:
    j = j * 2
    
  else:
    j = j + R
 
print(j)

Solution (Python):
n,k=map(int,open(0))
a=1
while a<k and n:a*=2;n-=1
print(a+k*n)

Solution (Python):
n=int(input())
k=int(input()) 
ans = 1
for i in range(n):
  ans = min(ans*2,ans+k)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 10**9
for i in range(N+1):
  num = 1
  for j in range(i):
    num *= 2
  for j in range(N-i):
    num += K
  if ans > num:
    ans = num
print(ans)

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

K = int(input())

dp = [0]*(N+1)
dp[0] = 1


for i in range(1, N+1, 1):

    dp[i] = min(dp[i-1]+K, dp[i-1]*2)

print(dp[N])

Solution (Python):
N = int(input().strip())
K = int(input().strip())

now = 1
for _ in range(N):
  if now <= K:
    now *= 2  
  else:
    now += K  

print(now)

Solution (Python):
N,K=map(int,open(0));L=1
for i in range(N):L+=min(L,K)
print(L)

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

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

ans=1
for i in range(n):
    if ans<k:
        ans=ans*2
    else:
        ans+=k
print(ans)

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

ans = 1
for i in range(n):
    ans = min(ans * 2, ans + k)

print(ans)

Solution (Python):
n = int(input())
k = int(input())
x = 1
for i in range(n):
    x = min(x*2, x+k)
print(x)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
    ans=min(ans*2,ans+k)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
n = 1
for i in range(N):
    if K >= n:
        n *= 2
    else:
        n += K
print(n)

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

res = 1
for _ in range(N):
    res = min(res*2,res+K)
print(res)

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

Solution (Python):
n, k = [int(input()) for _ in range(2)]
a = 1
for i in range(n):
    if a < k:
        a *= 2
    else:
        a += k

print(a)

Solution (Python):
def resolve():
    n = int(input())
    k = int(input())
    ans = 1
    for _ in range(n):
        ans += min(k, ans)
    print(ans)


if __name__ == "__main__":
    resolve()

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

Solution (Python):
n=int(input())
k=int(input())
ans=1
for _ in range(n):
    if ans<k:
        ans*=2
    else:
        ans+=k
print(ans)

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

count = 1

for i in range(N):
    count = min(2*count,count+K)

print(count)

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

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

    ans = 1
    for i in range(N):
        if ans < K:
            ans *= 2
        else:
            ans += K
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

N = int(input())
K = int(input())
ans = 1
for i in range(N):
    if ans * 2 < ans + K:
        ans *= 2
    else:
        ans += K
print(ans)

Solution (Python):

import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N = II()
K = II()
num = 1
for i in range(N):
    if num < K:
        num *= 2
    else:
        num += K
print(num)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())
k = int(input())

ans = 10**4

for i in range(n+1):
    ans = min(ans, 2**i+k*(n-i))

print(ans)

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

ans = 1
for i in range(n):
    if ans < k:
        ans *= 2
    else:
        ans += k

print(ans)

Solution (Python):
n,k = int(input()),int(input())
score = 1
for _ in range(n):
    if score<k : score*=2
    else: score+=k
print(score)

Solution (Python):
n = int(input())
k = int(input())
cnt = 0
ans = 1
while cnt < n:
    ans += min(ans, k)
    cnt += 1
print(ans)

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

ans = 1

for _ in range(n):
    if ans <= k:
        ans *= 2
    else:
        ans += k
print(ans)

Solution (Python):
def test():
    n = int(input())
    k = int(input())
    x = 1
    for i in range(n):
        if x*2 > x+k:
            x += k
        else:
            x *= 2
    print(x)


if __name__ == "__main__":
    test()

Solution (Python):
import sys
import  math
import bisect
from statistics import *
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
k = ni()
ans = 1000000000000000
for i in range(1 << n):
    tmp = 1
    for j in range(n):
        if i>>j&1:
            tmp *= 2
        else:
            tmp += k
    ans = min(ans, tmp)
print(ans)

Solution (Python):



N = int(input())
K = int(input())


ans = 1
for i in range(N):
    ans = min(2*ans, ans+K)


print(ans)

Solution (Python):
n = int(input())
k = int(input())
v = 1
while v <= k and n > 0:
    v *= 2
    n -= 1
v += n * k
print(v)

Solution (Python):
n = int(input())
k = int(input())
ans = [1,]

for i in range(n):
    if ans[i]*2 >= ans[i]+k:
        ans.append(ans[i]+k)
    else:
        ans.append(ans[i]*2)

print(max(ans))

Solution (Python):
N = int(input())
K = int(input())
num = 1
for i in range(N):
    if num < K:
        num = num*2
    else:
        num += K
print(num)

Solution (Python):
N = int(input())
K = int(input())
m = 1
for i in range(N):
  m = min(m+K, m*2)
print(m)

Solution (Python):
n = int(input())
k = int(input())
s = 1
for i in range(n):
    s = min(s * 2, s + k)
print(s)

Solution (Python):
ans = 1
N, K = map(int, [input() for _ in range(2)])
for _ in range(N):
    if ans * 2 > ans + K:
        ans += K
    else:
        ans *= 2
print(ans)

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

for i in range(n):
    ans = min(ans + k, ans * 2)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
  ans = min(ans*2,ans+k)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
    ans = min(2*ans,ans+k)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 10**10
for i in range(2**n):
    m = 1
    for j in range(n):
        if (i>>j)&1 == 1:
            m *= 2
        else:
            m += k
    ans = min(m,ans)
print(ans)

Solution (Python):
n=int(input())
k=int(input())
r=1
for i in range(n):
    r=min(2*r,r+k)
print(r)

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

ans = 1
for i in range(n):
    ans = min(ans * 2, ans + k)

print(ans)

Solution (Python):
N = int(input())
K = int(input())
r = 1
for i in range(N):
  r = min(r*2, r+K)
print(r)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for _ in range(n):
  ans=min(ans+k,2*ans)
print(ans)

Solution (Python):
n=int(input())
k=int(input())
a=1
for _ in range(n):
  a=min(a*2,a+k)
print(a)

Solution (Python):
n = int(input())
k = int(input())
x = 1
for i in range(n):
  x = min(x*2,x+k)
print(x)

Solution (Python):
import numpy as np
ans = 100000000000000000000000

n= int(input())
k = int(input())

for i in range(2**n):
    con = format(i,"b").zfill(n)
    temp = 1
    for c in con:
        if c == "1":
            temp += k
        else:
            temp *= 2
    if temp < ans:
        ans = temp

print(ans)

Solution (Python):
def add(x, y):
  ans = x + y
  return ans

def mux(x,y):
  ans = x * y
  return ans

n = int(input())
k = int(input())

ans = 1
min_ans = 1
cnt = 0

for i in range(n):
  min_ans = add(min_ans,k)


for i in range(n):
  ans = 1
  for j in range(n):
    if cnt < j:
      ans = add(ans, k)
    else:
      ans = mux(ans,2)
    
    

  if min_ans > ans:
    min_ans = ans
    
  cnt +=1
  
print(min_ans)

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

m = float('inf')
for i in range(N + 1) :
    m = min(m, 2 ** i + (N - i) * K)
print(m)

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

ans=1
for i in range(n):
  tmp1=ans*2
  tmp2=ans+k
  if tmp1>tmp2:
    ans=tmp2
  else:
    ans=tmp1
print(ans)

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

ans = 1

for _ in range(N):
	if ans < K:
		ans *= 2
	else:
		ans += K

print(ans)

Solution (Python):
n,k=[int(input()) for _ in range(2)]
ans=1
for i in range(n):
  ans=min(ans*2,ans+k)
print(ans)

Solution (Python):
n,k=[int(input()) for _ in range(2)]
ans=1
for i in range(n):
  ans=min(ans*2,ans+k)
print(ans)

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

ans = 1

for _ in range(n):
    if ans * 2 < ans + k:
        ans *= 2
    else:
        ans += k
print(ans)

Solution (Python):
def main():
    N = int(input())
    K = int(input())

    v = 1
    for _ in range(N):
        v = min(v*2, v+K)
    return v
if __name__ == '__main__':
    print(main())

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
    ans = min(ans*2,ans+k)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
num = 1

for i in range(n):
  num = min(num * 2, num + k)
  
print(num)

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

val = 1
for i in range(n):
  val = min(val + k, val * 2)
print(val)

Solution (Python):

N = int(input())
K = int(input())



def opeA(num):
    return num*2

def opeB(num, K = K):
    return num + K


num = 1

for i in range(N):
    if opeA(num) < opeB(num):
        num = opeA(num)
    else:
        num = opeB(num)


print(num)

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

ans=1

for i in range(n):
  if ans*2 < ans+k:
    ans = ans*2
  else:
    ans = ans+k

print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for _ in range(n):
    ans = min(ans*2, ans+k)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for _ in range(N):
    ans = min(ans * 2, ans + K)
print(ans)

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

x=1
for i in range(n):
    x+=min([x,k])

print(x)

Solution (Python):

n = int(input())
k = int(input())

num = 1
for i in range(n):
    if num * 2 > num + k:
        num += k
    else:
        num *= 2

print(num)

Solution (Python):




n = int(input())
k = int(input())
ans = 1
for i in range(n):
    ans = min(ans+k,ans*2)
print(ans)

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

num = 1
for _ in range(N):
    num = min(num*2, num+K)
print(num)

Solution (Python):
n= int(input())
k= int(input())
ans = 1
for i in range(n):
    ans = min(ans*2,ans+k)
print(ans)

Solution (Python):
n=int(input())
k=int(input())
num=1
for _ in range(n):
    if num+k >= num*2:
        num*=2
    else:
        num+=k
    
print(num)

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

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

Solution (Python):
n = int(input())
k = int(input())
t = 1
for i in range(n):
    t += min(k, t * 2 - t)
print(t)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
  ans=min(ans*2,ans+k)
print(ans)

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

dp = [0]*11
dp[0] = 1
for i in range(1, n+1, 1):
    dp[i] = min(dp[i-1]*2, dp[i-1]+k)
print(dp[n])

Solution (Python):
n = int(input())
k = int(input())
a = 1
for i in range(n):
    a = min(a*2, a+k)
print(a)

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

ans = 1
for i in range(N):
  ans = min(ans * 2, ans + K)
print (ans)

Solution (Python):
n = int(input())
k = int(input())
a = 1
for i in range(n):a=min(a*2,a+k)
print(a)

Solution (Python):
N = int(input())
K = int(input())
a = 1
for i in range(N):
  if a < K:
    a *= 2
  else:
    a += K
print(a)

Solution (Python):
import itertools

N, K = int(input()), int(input())

ans = 10 ** 10
for ops in itertools.product([True, False], repeat=N):
    val = 1
    for op in ops:
        val = val * 2 if op else val + K
    ans = min(ans, val)

print(ans)

Solution (Python):
import itertools

N = int(input())
K = int(input())

ans = 10 ** 10
for ops in itertools.product([True, False], repeat=N):
    val = 1
    for op in ops:
        val = val * 2 if op else val + K
    ans = min(ans, val)

print(ans)

Solution (Python):
n = int(input())
k = int(input())
r = 1
for i in range(n):
    r = min(r * 2, r + k)
print(r)

Solution (Python):
N, K = map(int, (input() for _ in range(2)))
res = 1

for i in range(N):
	res = min(res*2, res+K)
print(res)

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

f = 1
for i in range(N):
  if f*2 <= f+K:
    f*=2
  else:
    f+=K
    
    
print(f)

Solution (Python):
a = int(input())
b = int(input())
num=1

for _ in range(a):
  num=min(num*2,num+b)
print(num)

Solution (Python):
n=int(input())
k=int(input())
def nishinsu(i,n): 
    return str(bin(i)[2:]).zfill(n)
l=[]
for i in range(0,int("1"*n,2)): 
    s=1
    for j in nishinsu(i,n): 
        if j=="0":
            s=s*2
        else:
            s=s+k
    l.append(s)
print(min(l))

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

num=1
for i in range(n):
    if num<k:
        num*=2
    else:
        num+=k
print(num)

Solution (Python):
n, k = [int(input()) for _ in range(2)]
ans = 1
for _ in range(n):
    if ans > k:
        ans += k
    else:
        ans *= 2
print(ans)

Solution (Python):
import sys
import math
input=sys.stdin.readline

n = int(input())
k = int(input())

x = 1
for i in range(n):
    x = min(x*2, x+k)

print(x)

Solution (Python):
N = int(input())
K = int(input())
c = 1
for i in range(N):
  c = min(c*2, c+K)
print(c)

Solution (Python):
N,K=int(input()),int(input())
res=1
for _ in range(N):
  res=min(res*2,res+K)
print(res)

Solution (Python):
import math
n = int(input())
k = int(input())
l = int(math.log2(k))
a_count = min(n, l+1)
b_count = max(0, n-a_count)
print(2**a_count + k*b_count)

Solution (Python):
n,k=map(int,open(0).read().split())
c=1
for i in range(n):
  if c*2 <= c+k:
    c*=2
  else:
    c+=k
print(c)

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

for i in range(N):
  num = min(num*2,num+K)
print(num)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
  ans = min( 2 * ans , ans + k )
print(ans)

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

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

count = 1
for i in range(n):
    count = min(2*count,count+k)
print(count)

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

ans = 1
for i in range(n):
    if ans < k:
        ans *= 2
    else:
        ans += k
print(ans)

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

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

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

ret=1
for i in range(N):
    if ret*2>=(ret+K):
        ret+=K
    else:
        ret*=2

print(ret)

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

def choice(k, n):
    if n == 1:
        return min(1+k, 2)
    else:
        prev = choice(k, n-1)
        return min(prev+k, 2*prev)
print(choice(K, N))

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

a = 1

for i in range(n):
  
  if 2*a < a + k:
    a = a * 2
  
  else:
    a = a + k

print(a)

Solution (Python):
n,k=[int(input()) for _ in range(2)]

ans=1
t=[]

for i in range(n+1):
    t.append(2**i+k*(n-i))
    ans=1

print(min(t))

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

ans = 1

for i in range(N):
    ans = min(ans * 2 , ans + K)

print(ans)

Solution (Python):
n = int(input())
k = int(input())
num = 1
cnt = 0
while cnt<n:
    if num>k:
        num += k
    else:
        num *= 2
    cnt += 1
print(num)

Solution (Python):
n = int(input())
k = int(input())
num = 1
for i in range(n):
  num1 = num*2
  num2 = num+k
  if num1 >= num2:
    num = num2
  else:
    num = num1
print(num)

Solution (Python):
n = int(input())
k = int(input())
i = 1
for j in range(n):
  if i >= k:
    i += k
  else:
    i *= 2
print(i)

Solution (Python):
n = int(input())
k = int(input())
res = 1
for i in range(n):
  res = min(2*res,res+k)
print(res)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in [0]*n:
  ans += min(ans,k)
print(ans)

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

ans = float('inf')

for i in range(N+1):
    digit = 1
    tmp = digit * 2 ** i + (N - i) * K
    if ans > tmp:
        ans = tmp

print(ans)

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

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

Solution (Python):
n = int(input())
k = int(input())
now = 1
for i in range(n):
    now = min(now*2, now+k)
print(now)

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

ans=1

for n in range(N):
    cul_a=ans*2
    cul_b=ans+K
    ans=min(cul_a,cul_b)
print(ans)

Solution (Python):
N=int(input())
K=int(input())
ans=1
while ans<K and N>0:
    ans*=2
    N-=1
print(ans+N*K)

Solution (Python):
n = int(input())
k = int(input())
i = 0
a = 1

while a < k and i < n:
    a *= 2
    i += 1
print(a + k * (n - i))

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

if k == 1:
    print(n + 1)
else:
    i = 0
    a = 1
    while a < k and i < n:
        a *= 2
        i += 1
    print(a + k * (n - i))

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    K = int(input())

    answer = 1
    for i in range(N):
        answer = min(answer*2, answer+K)

    print(answer)

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math






def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    K = inputInt()
    
    ans = 1
    for _ in range(N):
        if ans <= K:
            ans = ans * 2
        else:
            ans += K
    
    print(ans)
    
            	
if __name__ == "__main__":
	main()

Solution (Python):
N = int(input())
K = int(input())
show = 1
for _ in range(N):
  if show > K:
    show += K
  else:
    show *= 2
print(show)

Solution (Python):
N = int(input())
K = int(input())
a = 1

for i in range(N):
  a+=min(a,K)

print(a)

Solution (Python):
N = int(input())
K = int(input())
a = 1

for i in range(N):
  a+=min(a,K)

print(a)

Solution (Python):
N = int(input())
K = int(input())
a = 1

for i in range(N):
  a = min(a+K,2*a)

print(a)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for i in range(N):
    tmp1 = ans * 2
    tmp2 = ans + K
    if tmp1 < tmp2:
        ans = tmp1
    else:
        ans = tmp2

print(ans)

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

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

Solution (Python):

import sys
INF = float("inf")


def solve(N: int, K: int):
    ans = 1
    for i in range(N):
        if ans <= K:
            ans *= 2
        else:
            ans += K
    print(ans)
    return


def main():

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


if __name__ == '__main__':
    main()

Solution (Python):
c = 1
n = int(input().split()[0])
k = int(input().split()[0])

for _ in range(n):
    if c + k < c * 2:
        c = c + k
    else:
        c = c * 2

print(c)

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

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
    s = ans + k
    m = ans * 2
    if s < m:
        ans = s
    else:
        ans = m
print(ans)

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

A = []

for n in range(N+1):
  ans = 1
  nm_A = n
  nm_B = N - n
  
  if nm_A > 0:
    for a in range(nm_A):
      ans *= 2
  
  if nm_B > 0:
    for b in range(nm_B):
      ans += K
  
  A.append(ans)

print(min(A))

Solution (Python):
a = int(input())
b = int(input())
c = 1
for i in range(a):
    if c <= b:
        c *= 2
    else:
        c += b
print(c)

Solution (Python):

n = int(input())
k = int(input())

X = []
for i in range(2**n):
    x = 1
    for j in range(n):
        if (i >> j) & 1:
            x = 2*x
        else:
            x = x+k
    X.append(x)

print(min(X))

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
    d = 2 * ans
    e = ans + k
    if d < e:
        ans = ans * 2
    else:
        ans += k
print(ans)

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

b = 1

for i in range(n):
  if b * 2 - b < k:
    b *= 2
  else:
    b += k

print(b)

Solution (Python):
n=int(input())
k=int(input())
a=1
for _ in [0]*n:
    a=min(2*a,a+k)
print(a)