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

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

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

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

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

print(now)

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

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

Solution (Python):


import itertools


def compute_min_num(n, k):
    res = float("inf")
    seqs = itertools.product((True, False), repeat=n)
    for ops in seqs:
        x = 1
        for is_a in ops:
            if is_a:
                x *= 2
            else:
                x += k
        res = min(res, x)
    return res


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


if __name__ == '__main__':
    main()

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

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

print(ans)

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

print(result)

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

m = 1

while n:
    n -= 1
    t1 = 2*m
    t2 = m + k

    if t1 < t2:
        m = t1
    else:
        m = t2

print (m)

Solution (Python):


import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        N = int(line)
        K = int(sys.stdin.readline())
        value = 1
        for i in xrange(N):
            value = min(2 * value, value + K)
        print(value)

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)

Solution (Python):
n , k = int(input()), int(input())
res = 1 << 63

def getAns(now, step):
    global res
    if step == n:
        res = min(res, now)
    if step <= n and now < res:
        getAns(now + k, step + 1)
        getAns(now * 2, step + 1)
getAns(1, 0)
print(res)

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

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

print(x)

Solution (Python):



"""076-b"""


import sys


def main():
    """Main function."""
    N = int(input())
    K = int(input())

    res = 1

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

    print(res)


if __name__ == '__main__':
    sys.exit(main())

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

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

Solution (Python):
n = input()
k = input()
out = 1
for x in xrange(n):
	out = min(2 * out, out + k)
print out

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

Solution (Python):
pnt=1
N=int(raw_input())
K=int(raw_input())
for t in range(N):
 if pnt<K:
  pnt=pnt*2
 else:
  pnt=pnt+K
print pnt

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

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

print(result)

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

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

main()

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(raw_input())
K=int(raw_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())
num = 1
for n 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())

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

print(Panel)

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

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

    print(ans)

solve()

Solution (Python):

"""
http://abc076.contest.atcoder.jp/tasks/abc076_b

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    current= 1
    N = int(input())
    K = int(input())

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



if __name__ == '__main__':
    main(sys.argv[1:])

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

a = 1

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

Solution (Python):
n=int(input())
k=int(input())
ans=1
while n>0:
	ans=min(2*ans,ans+k)
	n-=1
print(ans)

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

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

Solution (Python):
import sys,collections
sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

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

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

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

ans = 1
for i in range(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 * 2
    else:
        a = a + k

print(a)

Solution (Python):
def rec(num,k,i):
    if i==0:
        return num
    return min(rec(2*num,k,i-1),rec(num+k,k,i-1))

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

print(rec(1,k,n))

Solution (Python):

N=int(input().rstrip())
K=int(input().rstrip())
val=1
for i in range(N):
    tmpBy=val*2
    tmpPs=val+K
    if( tmpBy>tmpPs ):
        val=tmpPs
    else:
        val=tmpBy
print(val,flush=True)

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

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

    print(res)

if __name__ == "__main__":
    main()

Solution (Python):
from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readLine_int_list_reverse(): return list(map(int, stdin.readline().split())).reverse()
def readAll_int(): return list(map(int, stdin))
def readLine_str_list():return list(map(str, stdin.readline().split()))
def readAll_str(): return list(map(str, stdin))


def main():
	n,k = readAll_int()
	ans = 1
	for i in range(n):
	    _k = ans + k
	    _d = ans * 2 
	    ans = min(_k, _d)

	print(ans)

if __name__ == "__main__":
    main()

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

Solution (Python):

N = int(raw_input())
K = int(raw_input())

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

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

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

print(rec(0, 1))

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

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

print ans

Solution (Python):


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



if __name__ == '__main__':
	main()

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

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

print(val)

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(raw_input())
K = int(raw_input())

ans = 1

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

print ans

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

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

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

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):
a = int(input())
b = int(input())

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

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

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

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

Solution (Python):





import numpy as np
N = int(input())
K = int(input())

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

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

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

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

print(num)

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):
num = int(input())
num2 = int(input())

calc = 1
for i in range(num):
    if num2 > calc:
        calc *= 2
    else:
        calc += num2
print(calc)

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 itertools import product

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

ans = 10 ** 10
for ops in product([lambda x: x * 2, lambda x: x + k], repeat=n):
    v = 1
    for op in ops:
        v = op(v)
    ans = min(ans, v)
print(ans)

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

Solution (Python):



from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

n = int (raw_input ())
k = int (raw_input ())

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

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


ans = 1

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

print(ans)

Solution (Python):

def get_ln_inputs():
    return input().split()


def map_list(fn, xs):
    return list(map(fn, xs))


def get_ln_int_inputs():
    return map_list(int, get_ln_inputs())


def main():
    N = get_ln_int_inputs()[0]
    K = get_ln_int_inputs()[0]

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

    print(m)
    return


main()

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

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

print(num)

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

Solution (Python):
import sys

stdin = sys.stdin

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

n = ni()
k = ni()

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

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

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

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

print(res)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    k = I()
    r = 1
    for _ in range(n):
        r = min(r*2,r+k)

    return r


print(main())

Solution (Python):
N = input()
K = input()
X = 1
for i in xrange(N):
    X = min(X*2, X+K)
print X