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())
ans = 1

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

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

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

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

    else:
        integer = 2*integer

print(integer)

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 *= 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):
n = int(input())
k = int(input())

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

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

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

print(c)

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

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

print(outcome)

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

point = 1

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


print(point)

Solution (Python):
a = int(input())
b = int(input())
i = 1
out = 1

while i <= a:
  if out >= b:
    out += b
  else:
    out *= 2
  i += 1

print(out)

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

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())
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=ans+min(ans,k)
print(ans)

Solution (Python):
import math


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

A = min(N, math.ceil(math.log2(K)))

print(2 ** A + K * (N - A))

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

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

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

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

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

print(result)

Solution (Python):


N = int(input().rstrip())
K = int(input().rstrip())

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

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

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 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(0,n):
  if x<k:
    x=x*2
  else:
    x=x+k
print(x)

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

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

Solution (Python):
from sys import stdin


def main() -> None:
    n, k = [int(next_str()) for _ in range(2)]
    ans = 1
    for i in range(n):
        ans = min(ans * 2, ans + k)
    print(ans)


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


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
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):
	a = 2*ans
	b = ans +K
	ans = min(a, b)
print(ans)

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

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

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

print(x)

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

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

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

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())
c = 1

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

print(c)

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

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

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

print(ans)

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

risuto = [1]
for i in range(N):
    if (risuto[-1] + K > risuto[-1] * 2):
        risuto.append(risuto[-1] * 2)
    else:
        risuto.append(risuto[-1] + K)
        
print(max(risuto))

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

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

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

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):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
k = ni()

res = 1

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

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):
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 _ 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, k)
print(ans)

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

a = 1

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

    else:
        a += k

print(a)

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

index=0
currentN =1
while index < n:
    if currentN+k > currentN*2:
        currentN*=2
    else:
        currentN+=k
    index+=1

print(currentN)

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

num = 1

while num < K and N > 0:
	num <<= 1
	N -= 1
print(num+K*N)

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

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

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

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

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

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

ans += max(0, N - ind)*K
print(ans)

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

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

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

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

a_num = 0
val = 1
while val < k and a_num < n:
    val *= 2
    a_num += 1

ans = val + (n - a_num) * k
print(ans)

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

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

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

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


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


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


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

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


if __name__ == '__main__':
    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())

ans = 1e9


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

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

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

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

Solution (Python):

n=int(input())
k=int(input())
ass = 1

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

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

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 _ in range(N):
  s=min(s*2,s+K)
print(s)

Solution (Python):


def main():
	n = int(input())
	k = int(input())
	
	ans_list = []
	
	for i in range(2 ** n):
		a = "list('{:0" + str(n) + "b}'.format(i))"
		temp = 1
		lists = [int(x) for x in eval(a)]
		for j in lists:
			if j == 0:
				temp += k
			else:
				temp *= 2
		ans_list.append(temp)

	print(min(ans_list))

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

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

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

print(re)

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

Solution (Python):
from functools import reduce
n = int(input())
k = int(input())
print(reduce(lambda a, x: min(a * 2, a + k), range(n), 1))

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

def main():
    n = int(input())
    k = int(input())


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

    print(ans)


if __name__ == "__main__":
        main()

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

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

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

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

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):
from collections import defaultdict 
import sys,heapq,bisect,math,itertools,string

sys.setrecursionlimit(10**8)


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(0,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):
N = int(input())
K = int(input())
x = 1
for i in range(N):
	if x * 2 >= x + K:
		x = x + K
	else:
		x = x * 2

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

Solution (Python):
"""
https://abc076.contest.atcoder.jp/tasks/abc076_b
"""
a=1
n=int(input())
k=int(input())
for i in range(n):
    if a*2>a+k:
        a=a+k
    else:
        a=a*2
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())
x=1
for i in range(1,N+1):
	if 2*x<x+K:
		x=2*x
	else:
		x=x+K

print(x)

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

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

Solution (Python):
N = int(input())
K = int(input())
n = 0
i = 1
while n < N:
  if i <= K:
    n += 1
    i = i*2
  elif i > K:
    n += 1
    i = i + K
print(i)

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

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

a=1

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

Solution (Python):

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


min_ans = 1 + K*N

for i in range(1, N+1):
    ans = 2 ** i + K*(N-i)
    if ans<min_ans:
        min_ans = ans

print(min_ans)

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

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

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

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

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

print(m)

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

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

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

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

Solution (Python):


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

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

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

print(res)

Solution (Python):
def main():
    N = int(input())
    K = int(input())
    out = 1
    for _ in range(N):
        out = min(out*2, out+K)
    return out

if __name__ == '__main__':
    print(main())

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

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

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 = 2 ** N

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

print(ans)

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

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

print(cnt)

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

Dis = 1

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

print(Dis)

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

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

print('{}'.format(a))

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

result = 1

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

print(result)

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

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

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

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


print(number)

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

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

now = 1

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

print(now)

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

print(now)

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

Solution (Python):
n, k = int(input()), int(input())
s = 1
while(n):
    s += min(s, k)
    n -= 1
print(s)

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

def dfs(i, s):
  if i == N:
    return s
  else:
    if (i, s) in memo:
      return memo[(i, s)]
    tmp = min(dfs(i + 1, s * 2), dfs(i + 1, s + K))
    memo[(i, s)] = tmp
    return tmp

print(dfs(0, 1))

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

def ans(i,x):
    if i == 0:
        return min(2*x, x+K)
    else:
        return min(ans(i-1, 2*x), ans(i-1, x+K))

print(ans(N-1, 1))

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

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

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

ans = 1

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

print ans

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

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

Solution (Python):
n=int(raw_input())
k=int(raw_input())
ip=1

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

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):
y=int(input())
y1=int(input())
s=1
for i in range(y):
  if s*2<s+y1:
    s*=2
  else:
    s+=y1


print(s)

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


print(s)

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

count=1

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

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

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

print(a)

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

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

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

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

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

Solution (Python):
import math
import sys

def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()


def valuecheck(x, k):
    
    
    if (x * 2) <= (x + k):
    
        return x * 2
    
    else:
        
        return x + k

n = int(arr_data[0][0])
k = int(arr_data[1][0])




cnt = 0

x = 1

while cnt < n:

    x = valuecheck(x, k)
    
    cnt += 1


print(x)

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

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

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

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())
num = 1

def plus(num, k):
    return num + k

def double(num):
    return num * 2

for i in range(n):
    if plus(num, k) < double(num):
        num = plus(num, k)
    else:
        num = double(num)
print(num)

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

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

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

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 _ in range(n):
    ans += min(ans, k)
print(ans)

Solution (Python):
n, k, ans = int(input()), int(input()), 1
for _ in range(n):
    ans += min(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):
from collections import deque

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

Q = deque([(1, 0)])
H = []
while Q:
    q = Q.popleft()
    if q[1] == N:
        H.append(q[0])
    else:
        Q.append((q[0] * 2, q[1] + 1))
        Q.append((q[0] + K, q[1] + 1))

print(min(H))

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

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

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

n = ni()
k = ni()

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

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

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

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

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

i = 1

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

print(i)

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

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

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

Solution (Python):





if __name__ == '__main__':
    operation_count = int(input())
    incremental_value = int(input())
    candidates = list()

    for i in range(operation_count + 1):
        result = 2 ** i + (operation_count - i) * incremental_value
        candidates.append(result)

    print(min(candidates))

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

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

print(dis)

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

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

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


sys.setrecursionlimit(10000)


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


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


def dim2input(N):
    li = []
    for _ in range(N):
        li.append(input().split())
    return li



dp = None

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


    minimum_value = 10**9
    for seq in itertools.product("01", repeat=N):
        value = 1
        for binary in seq:
            if binary == "0":
                value *= 2
            else:
                value += K
        minimum_value = min(value, minimum_value)

    print(minimum_value)

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)