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):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, K = map(int, read().decode('utf8').split())
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(2*ans, ans+K)
print(ans)

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

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

Solution (Python):
n = int(input())
k = int(input())
d = 1
while n:
  if d < k:
    d *= 2
  else:
    d += k
  n -= 1
print(d)

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

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

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 += (N - i) * K
        break

print(ans)

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

print(answer)

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

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

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

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

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

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

Solution (Python):
import math



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

ans = 1

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

print(ans)

Solution (Python):
from itertools import product
N, K = int(input()), int(input())
F = lambda x:x*2, lambda x:x+K
ans = 10000
for prod in product(F, repeat=N):
    x = 1
    for f in prod:
        x = f(x)
    ans = min(ans, x)
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())
start=1
for i in range(n):
    if start*2-start<=k:
        start*=2
    else:
        start+=k
print(start)

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

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

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

print(point)

Solution (Python):


import numpy as np

n=int(input())
k=int(input())
res=1
for a_ in range(n):
    res=min(res+k,res*2)

print(res)

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











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

print(m)

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

min_m = 10 ** 10
for i in range(2 ** N):
    m = 1
    for n in range(N):
        if i & (1 << n):
            m *= 2
        else:
            m += K
    min_m = min(min_m, m)

print(min_m)

Solution (Python):
import sys
input = sys.stdin.readline
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())

s = 1

for i in range(n):
  if s <= k:
    s *= 2
  elif s > k:
    s += k
    
print(s)

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

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

Solution (Python):
N,K=[int(input()) for i in range(2)]
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):
  if ans < k:
    ans += ans
  else:
    ans += k
print(ans)

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

Solution (Python):
import sys
input = sys.stdin.readline
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 * 2 < num + k:
        num = num * 2
    else:
        num = num + k

print(num)

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

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
K = int(input())
x = 1
for _ in range(N):
    x += min(x, K)
print(x)

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

Solution (Python):
N = int(input())
K = int(input())
num = 1
for i in range(N):
  a = num * 2
  b = num + K
  if a <= b:
    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 = int(input())
k = int(input())


def double(i):
    return i*2

def add_k(i):
    return i+k

ans= 1
for j in range(n):
    if ans <= k:
        ans = double(ans)

    else:
        ans = add_k(ans)

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

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

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

print(v)

Solution (Python):
import copy
n = int(input())
k = int(input())
b = [[]]
for i in range(n):
    tmp = len(b)
    for j in range(tmp):
        b.append(copy.copy(b[j]))
        '''
        b.append([])
        for l in range(len(b[j])):
            b[j+tmp].append(b[j][l])
        '''
    for j in range(tmp):
        b[j].append(0)
        b[j+tmp].append(1)


m = 2 ** 11
for i in range(len(b)):
    num = 1
    
    for j in range(n):
        if b[i][j] == 0:
            num *= 2
        else:
            num += k
        
    m = min(m, num)
    
print(m)

Solution (Python):

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

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

Solution (Python):
n = int(input())
k = int(input())
b = [[]]
for i in range(n):
    tmp = len(b)
    for j in range(tmp):
        b.append([])
        for l in range(len(b[j])):
            b[j+tmp].append(b[j][l])
    for j in range(tmp):
        b[j].append(0)
        b[j+tmp].append(1)


m = 2 ** 11
for i in range(len(b)):
    num = 1
    
    for j in range(n):
        if b[i][j] == 0:
            num *= 2
        else:
            num += k
        
    m = min(m, num)
    
print(m)

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

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

print(x)

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

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

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

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

print(x)

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

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

n, k = map(int, sys.stdin.read().split())

def main():
    x = 1
    for _ in range(n):
        if x > k:
            x += k
        else:
            x *= 2
    return x

if __name__ == '__main__':
    ans = main()
    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())
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())
result = 1
for i in range(n):
  if result>k:
    result+=k
  else:
    result*=2
print(result)

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

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

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

b=2**n
ans=999999999999999999
for i in range(b):
    bit_b=bin(i)[2:].zfill(n)
    ans_i=1
    for j in range(len(bit_b)):
        if(bit_b[j]=='0'):
            ans_i*=2
        elif(bit_b[j]=='1'):
            ans_i+=k

    if(ans>ans_i):
        ans=ans_i

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

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

print(ans)

Solution (Python):
a = 1
s = int(input())
d = int(input())
for i in range(s):
    a += min(a,d)
print(a)

Solution (Python):
n=int(input())
k=int(input())
def func(a,k):
    return(min(2*a, a+k))
ans=1
for i in range(n):
    ans=func(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())

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

print(ans)

Solution (Python):

import sys, math, itertools, heapq, collections, bisect, string
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
mod = 10**9+7
ans = inf ;count = 0 ;pro = 1

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

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

num = 1

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

print(num)

Solution (Python):
n, k = map(int, (input(), 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):
n = int(input())
k = int(input())
d = 2**15
for i in range(1 << n):
    c = 1
    for j in range(n):
        if ((i >> j) & 1) == 1:
            c *= 2
        else:
            c += k
    else:
        d = min(c,d)
print(d)

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

ans = 1



for I in range(N):
    if ans*2 <= ans + K:
        ans = ans*2
        
    elif ans*2 >= ans + K:
        ans = ans + K
        
print(ans)

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

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

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

ls = [1]

for i in range(n):
    ls.append(min(ls[i] * 2, ls[i] + k))

print(ls[n])

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

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

print(c)

Solution (Python):
from math import log
n,k = int(input()), int(input())

a = int(log(k, 2))
if n > a + 1:
    print(2 ** (a + 1) + (n - a - 1) * k)
else:
    print(2 ** n)

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

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

print(integer)

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

dp = [1] * (n+1)

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

print(dp[n])

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

ans = 1

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

print(ans)

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

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

print(ans)

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

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):
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 A(n):
    return n*2

def B(n):
    return n+K

ans = 1

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

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

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

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

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

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


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

print(n)

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

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

print(res)

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

num = 1

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

print(num)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n=int(input())
    k=int(input())
    ans=1
    for _ in range(n):
        ans=min(ans*2,ans+k)
    print(ans)
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):
from sys import stdin
import math
import bisect
import heapq
import numpy as np
from math import factorial

p = int(stdin.readline().rstrip())
k = int(stdin.readline().rstrip())

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

print(n)

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

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

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

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

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

    print(ans)


if __name__ == "__main__":
    n = int(input())
    k = int(input())

    main(n, k)

Solution (Python):
def examB():
    N = I(); K = I()
    cur = 1
    for i in range(N):
        cur = min(cur*2,cur +K)
    print(cur)

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

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

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

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()) for _ in range(2)]
the_number = 1

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

print(the_number)

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, K = [int(input()) for _ in range(2)]
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())
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):
    a = 2 * ans
    b = K + ans
    if a <= b:
        ans = a
    else:
        ans = b
print(ans)

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


def nibai(n):
    return n*2

def tasu_k(n,k):
    return n+k

num=1
for i in range(n):
    if(num>k):
        num=tasu_k(num,k)
    else:
        num=nibai(num)
print(num)

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

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):
  left = 2 * ans 
  right = ans + k
  ans = min(left,right)
  
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 10**8
for i in range(2**N):
    temp = 1
    for j in range(N):
        if (i>>j) & 1:
            temp += K
        else:
            temp *= 2
    if temp < ans:
        ans = temp
print(ans)

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

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

print(num)

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

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

Solution (Python):



N, K = map(int, open(0).read().split())


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

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

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

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

Solution (Python):
from sys import stdin
n, k = (int(x) for x in stdin.read().split())

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

print(displayed)

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,k=map(int,open(0).read().split())
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 n 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 += k
    else:
        num *= 2

print(num)

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


def checker(num):	
	if num > k: 
		return num+k
		
	else:
		return num*2
		

num = 1
for var in range(0,n):
	num = checker(num)
print(num)

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

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

Solution (Python):

n = int(input())
k = int(input())
shown = 1
def manA(x):
  return 2 * x

def manB(x):
  return k + x

for _ in range(n):
  shown = min(manA(shown),manB(shown))

print(shown)

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())
count = 0
result = 1
while count < n:
  result = min(result * 2, result + k)
  count += 1
print(result)

Solution (Python):
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = inputs[0]
    K = inputs[1]

    current = 1
    for i in range(N):
        if current < K:
            current += current
        else:
            current += K
    return current


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(int_inputs(2))
    print(ret)

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

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

print(num)

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

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

print(ans)

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

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

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

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

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

Solution (Python):
A = 1
N = int(input())
K = int(input())
for _ in range(N):
  A = min(A + K, 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())
i = 0
sum =1
while i != N:
	if sum < K:
		sum = sum*2
	else:
		sum += K
	i += 1
print(sum)

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

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

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

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

print(a)

Solution (Python):
def main():
    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)


if __name__ == "__main__":
    main()

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

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

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

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

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 += K
        
print(ans)

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

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

ans=2**N

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

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