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):
N = int(input())
K = int(input())

x = 1
for _ in range(N):
  x += min(x, K)

print(x)

Solution (Python):
def answer(n: int, k: int) -> int:
    current_num = 1
    for _ in range(n):
        current_num = min(current_num * 2, current_num + k)

    return current_num


def main():
    n =int(input())
    k = int(input())
    print(answer(n, k))


if __name__ == '__main__':
    main()

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):
    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):
    if ans*2 > ans+k:ans += k
    else:ans *= 2
print(ans)

Solution (Python):
def main():
        n=int(input())
        k=int(input())
        a=1
        while(n>0):
            a=min(a+k,2*a)
            n-=1
        print(a)
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())

out =  1
flg = 0
for i in range(N):
    if not flg:
        out *= 2
        if out > K:
            flg = 1
    else:
        out += K

print(out)

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

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

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())
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

def A(n):
   return 2 * n

def B(n):
   return n + K

for i in range(N):
   if A(ans) <= B(ans):
      ans = A(ans)
   else:
      ans = B(ans)

print(ans)

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    K = I()

    ans = 1
    while ans < K and N > 0:
        ans *= 2
        N -= 1
    ans += N * K

    print(ans)

if __name__ == '__main__':
    resolve()

Solution (Python):
N = int(input())
K = int(input())
j = 1
def func(x, y):
    r = (x * 2) if (x * 2) < (x + y) else  (x + y)
    return r

for i in range(N):
    j = func(j, K)
print(j)

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

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

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

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

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

Solution (Python):
from functools import reduce

def operator(x, K, N):
    res = (lambda x: 2*x if x < K else x+K)(x)
    return res if N == 1 else operator(res, K, N-1)

def main():
    with open(0) as f:
        N, K = map(int, f.read().split())
    ans = operator(1, K, N)
    print(ans)

main()

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

ans = 1

for i in range (0 , 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())

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

Solution (Python):
ans=float('inf')
n,k=int(input()),int(input())
for i in range(2**n):
    ans=min(ans,eval('('*n+'1'+"".join('*2)'if (i>>j)%2 else '+'+str(k)+')' for j in range(n))))
print(ans)

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

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

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

Solution (Python):

n=int(input())
k=int(input())
f=1
for i in range(0,n):
    if f*2<f+k:
        f=f*2
    else:
        f=f+k
print(f)

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

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

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



for i in range(0,n):
	given_integer=min(given_integer*2,given_integer+k)

print(int(given_integer))

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

ans = float("inf")
for i in range(N+1):
  num = 1 * (2 ** i) + K * (N - i)
  ans = min(ans, num)
  
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):
  if x + k <= 2*x:
    x += k
  else:
    x *= 2
print(x)

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())
s=1
for i in range(n):
  s=min(s*2,s+k)
print(s)

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

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

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

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

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())


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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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())

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

Solution (Python):
import sys

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

c = 0
tmp = 1
while c < N:
    if tmp < K:
        tmp *= 2
    else:
        tmp += K
    c += 1
    

print(tmp)

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())
ans=1
for i in range(n):
    ans=min(ans+k,ans*2)
print(ans)

Solution (Python):
from itertools import product
N = int(input())
K = int(input())
cmin = 10**4
for x in product((0,1),repeat=N):
    cnt = 1
    for i in range(N):
        if x[i]==0:
            cnt = cnt*2
        else:
            cnt += K
    cmin = min(cmin,cnt)
print(cmin)

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

from itertools import product

pr = list(product([0,1],repeat=n))

ans=float('inf')
for p in pr:

    tmp=1
    for i in p:
        if i==0:
            tmp*=2
        else:
            tmp+=k

    ans= min(ans,tmp)


print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Solution (Python):
def solve():
    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__":
    solve()

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

INF = 10**10

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  


N,K = I(),I()
ans = 10**6
for i in range(N+1):
    a = 2**i
    a += K*(N-i)
    ans = min(ans,a)

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())

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 _ 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(ans*2,ans+k)
print(ans)

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

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

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    k = I()
    num = 1
    for i in range(n):
        num = min(num+k, num*2)
    ans = num
    print(ans)

main()

Solution (Python):
def main():
    n, k = int(input()), int(input())
    x = 1

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


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n, k = int(input()), int(input())
    cnt = 0
    x = 1

    for _ in range(n):
        x *= 2
        cnt += 1
        if x > k:
            break

    print(x + k * (n - cnt))


if __name__ == "__main__":
    main()

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

value = 1

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

print(value)

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):
    if a<k:
        a = a*2
    else:
        a+=k
print(a)

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

Solution (Python):
N = int(input())
K = int(input())
x = 1
for _ 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):
  ans = min(ans*2,ans+K)
print(ans)

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

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

Solution (Python):

import math

ans = 1
count = 0
num1 = int(input())
num2 = int(input())
for i in range(num1):
    if ans < num2:
        ans *= 2
    else:
        ans += num2
print(ans)

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

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

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

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

print(ref)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    cur = 1

    for _ in range(N):
        cur = min(2 * cur, cur + K)

    print(cur)


if __name__ == '__main__':
    main()

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

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

print(now)

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

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):
  if a<=k:
    a*=2
  else:
    a+=k

print(a)

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())
ans = 1
for i in range(n):
    ans = min(ans*2,ans+k)
print(ans)

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

Solution (Python):
N = int(input())
K = int(input())
X = 1
for i in range(N):
    if X<K:
        X += X
    else:
        X += K

print(X)

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

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

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

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

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

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, k = [int(input()) for i in range(2)]
a = 1
for i in range(n):
  if a * 2 > a + k:
    a += k
  else:
    a *= 2
print(a)

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):
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())




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

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())

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

print(str(start))

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

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

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

number=1

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

Solution (Python):
n = int(input())
k = int(input())
 
num = 1
count = 0
 
while count < n:
    num = min(num * 2, num + k)
    count += 1
  
print(num)

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())
n=1
for i in range(N):
    if n<K:
        n*=2
    else:
        n+=K
print(n)

Solution (Python):
n = int(input())
k = int(input())
mini = 10**10

for i in range(2 ** n):
    x = 1
    for j in range(n):
        if ((i >> j) & 1):
            x *= 2
        else:
            x += k
    mini = min(mini,x)
print(mini)

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

print(start)

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

while n > cnt:
    ans = min(ans*2, ans+k)
    cnt += 1
    
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, k = [int(input()) for _ in range(2)]

result = 10 ** 9

for bit in range(2 ** n):
  
  tmp = 1
  for i in range(n):
    if bit & (1 << i):
      tmp *= 2
    else:
      tmp += k
  
  result = min(result, tmp)
  
print(result)

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

Solution (Python):
N=int(input())
K=int(input())
ans=1000
for i in range(N+1):
    num=1
    for s in range(i):
        num = num*2
    
    for t in range(N-i):
        num += K
    
    if num < ans:
        ans = num

print(ans)

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 r in range(n):
    if ans <= k:
        ans *= 2
    else:
        ans += k

print(ans)

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

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

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

Solution (Python):
n,k=int(input()),int(input());a=1
while a<=k:
  if n==0:
    print(a)
    exit()
  a*=2
  n-=1
while n>0:
  a+=k
  n-=1
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):
n,k=int(input()),int(input())
ans=1
i=0
while i!=n:
    if ans>=k:
        ans+=k
    else:
        ans*=2
    i+=1
print(ans)

Solution (Python):


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

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

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

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

Solution (Python):
n = int(input())
k = int(input())
num = 1
for i in range(n):
    if num*2 <= num+k:
        num *= 2
    else:
        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,k = int(input()),int(input())
ans = 1
for i in range(n):
    ans = min(ans+k,ans*2)
print(ans)

Solution (Python):
n,k = int(input()),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 _ in range(n):
    if ans * 2 > ans + k:
        ans += k
    else:
        ans *= 2
print(ans)

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

start = 1

for n in range(N):
    start = min(start*2, start+K)

print(start)

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

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*2 <= ans+k:
        ans = ans*2
    else:
        ans = ans+k
print(ans)

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 = 2**n
for i in range(n+1):
    tmp = 2**i + k*(n-i)
    ans = min(ans,tmp)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
x = 1
for i in range(n):
    if x < k:
        x *= 2
    else:
        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 *= 2
    else:
        num += k
print(num)

Solution (Python):
N,K = (int(input()) for T in range(0,2))
Num = 1
for TN in range(0,N):
    Num = min(2*Num,Num+K)
print(Num)

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

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

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

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

while n>0:
  if tmp*2>(tmp+k):
    tmp +=k
  else:
    tmp *=2
  n -= 1
    
print(tmp)

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

a = 1

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

print(a)

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())
num = 1
for i in range(N):
    if num >= K:
        num += K
    elif num < K:
        num += num
print(num)

Solution (Python):










import sys

def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]

def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)


N = iIn()
K = iIn()

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 += k
    else:
        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())

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

print(n)

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
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    K=ii()

    ans = INF
    for a in range(N+1):
        b = N-a
        res = 1
        for i in range(a):
            res *= 2

        for j in range(b):
            res += K

        ans = min(ans,res)

    
    print(ans)


    


if __name__ == "__main__":
    main()

Solution (Python):
def f(current, n,k):
	if n == 0:
		return current
	return min(f(2*current, n- 1,k), f(+k + current, n- 1, k)) 
print f(1,int(raw_input()), int(raw_input()))

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

ans = 1

for _ in range(N):
    ans += min(ans, K)

print(ans)

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

Solution (Python):
N=int(input())
K=int(input())
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 i in range(n):
    ans=min(2*ans,ans+k)
print(ans)

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

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

print(num)

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

ans = 1
for _ 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 <= K:
    ans*=2
  else:
    ans+=K
print(ans)

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

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(ans * 2, ans + k)
print(ans)

Solution (Python):

















import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
K = INT()
ans = 1
for _ 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=float('inf')
for b in range((1<<n)):
  cand=1
  for i in range(n):
    if b>>i&1:
      cand*=2
    else:
      cand+=k
  ans=min(ans,cand)
print(ans)

Solution (Python):
n=int(input())
k=int(input())
ans=float('inf')
for i in range(2**n):
  c=1
  tmp=format(i, '0'+str(n)+'b')
  for j in tmp:
    if j=='0':
      c*=2
    else:
      c+=k
      
  ans=min(c, ans)
  
print(ans)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, K = map(int, read().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
n,k=int(input()),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 _ in range(N):
	if  2*ans > ans+K:
		ans += K
	else:
		ans *= 2

print(ans)

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

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

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



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

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

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

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


if __name__ == "__main__":
    solve()

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())

N = I()
K = I()

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+=K
  else:
    ans*=2
print(ans)

Solution (Python):

import math

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

ans = 1


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

print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    K = int(input())
    ans = 10**18
    for i in range(1 << N):
        val = 1
        for j in range(N):
            if i & (1 << j):
                val *= 2
            else:
                val += K
        ans = min(ans, val)
    print(ans)


if __name__ == "__main__":
    main()

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=int(input())
k=int(input())
a=1
for _ in range(n):
    a=min(a*2,a+k)
print(a)

Solution (Python):
A=int(input())
B=int(input())
z=1
for i in range(A):
	if z+B<2*z:
		z=z+B
	else:
		z=2*z
print(z)

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

current = 1

for i in range(N_kai):
    can_1 = current + K
    can_2 = current * 2
    
    current = min(can_1, can_2)

print(current)

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

ans = 9999999999

for i in range(2 ** N):
    ans_tmp = 1
    for b in format(i, "0%db" %N):
        if b == "0":
            ans_tmp *= 2
        else:
            ans_tmp += K
    ans = min(ans, ans_tmp)
    
print(ans)

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

Solution (Python):
N,K=int(input()),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):
    if a <= k:
        a *= 2
    else:
        a += k 
print(a)

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

ans = 1
for _ in range(n):
    ans = min(2 * ans, ans + k)
else:
    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):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
k = I()
ans = 1
for i in range(n):
    ans = min(ans+k, ans*2)
print(ans)

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