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.



Sample input:
4
3


Sample output:
10

Submission status: Accepted

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

num = 1

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

print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import sys
# import math #sqrt
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import permutations #順列生成
# import collections # deque
# from operator import itemgetter
# from fractions import Fraction

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

def readInt():
    return list(map(int,input().split()))

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

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc076/tasks/abc076_b

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

min_ans = -1

def dfs(n, count):
    global min_ans

    if count == N:
        if n < min_ans or min_ans < 0:
            min_ans = n
        return

    dfs(n * 2, count + 1)
    dfs(n + K, count + 1)

dfs(1, 0)
print(min_ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
ans = [1]
for i in range(n):
    if ans[i] < k:
        ans.append(2*ans[i])
    else:
        ans.append(ans[i] + k)
print(ans[n])

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
N = int(input())
K = int(input())
tmp = [2**(i+1)-2**i for i in range(10)]
t = 1
for i in range(N):
    if 2**i < K:
        t *= 2
    else:
        t += K
print(t)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
val = 1
while cnt < N:
    if val <= K:
        val *= 2
    else:
        val += K
    cnt += 1

print(val)

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
k = ii()

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


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


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
k=int(input())
cur=1
while n>0:
    if cur+k<=cur*2:
        cur+=k
    else:
        cur*=2
    n-=1
print(cur)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#ABC 076
N = int(input())
K = int(input())

def sousa(a, n, k):
	if(n==0): return a;
	else: return min(sousa(a*2,n-1,k), sousa(a+k,n-1,k))

print(sousa(1, N, K))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
k=int(input())
x=1

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

Submission status: Accepted

Solution code:
def f(i):
    global m
    if i == n:
        c = 1
        for j in s:
            if j == 0:
                c *= 2
            else:
                c += k
        if m > c:
            m = c
        return
    f(i + 1)
    s[i] = 1
    f(i + 1)
    s[i] = 0

n = int(input())
k = int(input())
s = [0] * n
m = 114514
f(0)
print(m)

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
result = 1


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
val=1
for i in range(a):
    if 2*val>=val+b:
        val+=b
    else:
        val*=2
print(val)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(x)

Submission status: Accepted

Solution code:
N = int(input())
K = int(input())
sum = 1

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

print(sum)

Submission status: Accepted

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

    print(r)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Sat Mar 14 11:34:11 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

n, k = nin(2)

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

print(ans)

Submission status: Accepted

Solution code:
#pypyは内包表記使わない
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
K=int(input())
answer=1
for a in range(N):
    if answer*2>=answer+K:
        answer+=K
    else:
        answer*=2
print(answer)

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():

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

resolve()

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
now = 1
def a(n): return n * 2
def b(n): return n + k
for _ in range(n):
    now = min(a(now), b(now))
print(now)

Submission status: Accepted

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

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

print(num)

Submission status: Accepted

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


def rec(i, d):
    if i == n:
        return d
    return min(rec(i + 1, d + k), rec(i + 1, d * 2))


print(rec(0, 1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
K = int(input())
 
def func(a):
  ans = 1
  for n in range(a):
    ans = ans*2
  for n in range(N-a):
    ans = ans + K
  return ans
 
print(min([func(i) for i in range(N+1)]))

Submission status: Accepted

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

print(x)

Submission status: Accepted

Solution code:

n = int(input())
k = int(input())
a = [1]

for i in range(n):
    if a[i] <= k:
        a.append(a[i] *2)
    else:
        a.append(a[i] + k)
#print(a)
print(a[-1])

Submission status: Accepted

Solution code:
from sys import stdin

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
K=int(input())
ans=float('inf')
for i in range(2**N):
    bi=list(format(i,'b').zfill(N))
    now=1
    for b in bi:
        if b=='0':
            now*=2
        else:
            now+=K
    if now<ans:
        ans=now
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
#print('n={}, k={}'.format(n,k))

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

print(val)

Submission status: Accepted

Solution code:
##Addition and Multiplication
prod = 1
n = int(input())
k = int(input())
for x in range(n):
    if (prod < k):
        prod *= 2
    else:
        prod += k
print(prod)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input().strip())
K = int(input().strip())
#-----

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

Submission status: Accepted

Solution code:
N = int(input())
K = input()
num = 1
ops = ["*2", "+" + K]

for _ in range(N):
    min = -1
    for op in ops:
        result = eval(str(num) + op)
        if min == -1 or result < min:
            min = result
    num = min

print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
k=int(input())
s=1

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#ABC076

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

Submission status: Accepted

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

ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
N, K = [int(input()) for i in range(2)]

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

print(v)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
ans = 1
for _ in range(a):
    if ans < b:
        ans *= 2
    else:
        ans += b
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
K=int(input())
a=[1,2]
for i in range(2,N+1):
    if a[i-1]<K:
        a.append(a[i-1]*2)
    else:
        a.append(a[i-1]+K)
print(a[N])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#076_B
n=int(input())
k=int(input())
x=1
for _ in range(n):
    x=min(x*2,x+k)
print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
x = 1
i = 0
while i < n:
	i += 1
	x = min(2*x, k+x)
print (x)

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    K=I()
    ans=1
    for i in range(N):
        if ans<K:
            ans*=2
        else:
            ans+=K
    print(ans)
        

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def re_def(num, c, n=n, k=k):
    if c==n:
        return num
    for i in range(2):
        if i==0:
            num1 = re_def(num*2, c+1)
        else:
            num2 = re_def(num+k, c+1)
    return min([num1, num2])
print(re_def(1,0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
K = int(input())
num = 1
for i in range(N):
    num += min(num, K)
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    k = int(input())
    score = 1
    for _ in range(n):
        score = min(score * 2, score + k)
    print(score)


if __name__ == "__main__":
    main()

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
x = 1

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

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
ans = 1
for _ in range(n):
    dn, dk = ans, k
    ans += min(ans, k)
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    K = int(input())
    answer = 1
    for _ in range(N):
        if answer > K:
            answer += K
        else:
            answer *= 2
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def doubleork(n, k):

    ans = 1

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

    return ans


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
k = int(input())
ans = 1
for x in range(n):
    ans += min(ans, k)
print(ans)

Submission status: Accepted

Solution code:
n,k=[int(input()) for _ in range(2)]
num=1
for i in range(n):
    num_a=2*num
    num_b=num+k
    if num_a<num_b:
        num=num_a
    else:
        num=num_b
print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input().strip())
k = int(input().strip())
ans = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(r)

Submission status: Accepted

Solution code:
N = int(input())
K = int(input())
i = 1
m = 1
while i <= N:
  if m < K:
    m = 2*m
  else:
    m += K
  i += 1
print(m)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
K = int(input())
i = 1

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

Submission status: Accepted

Solution code:
try:
    N = int(input())
    K = int(input())
    a = 1
    for i in range(N):
        if a*2<a+K:
            a = a*2
        else:
            a = a+K
    print(a)
except EOFError:
    pass

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    K = int(input())
    result = 1
    for _ in range(N):
        result = min(2 * result, K + result)
    print(result)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

point = 1

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

print(point)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


ans = 1

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

Submission status: Accepted

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

ans = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)