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

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

print(x)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(result)

Submission status: Accepted

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

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

main()

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

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

print n

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

print(Panel)

Submission status: Accepted

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

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

    print(ans)

solve()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
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:])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## -*- coding:utf-8
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)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#http://abc076.contest.atcoder.jp/
# -*- coding: utf-8 -*-

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)

Submission status: Accepted

Solution code:
# coding: utf-8
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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8

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

Submission status: Accepted

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

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

print(val)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
num = int(input())
num2 = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
# coding: utf-8
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()

Submission status: Accepted

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

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

print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
#include <cmath>
#include <climits>
#include <cstdint>
using namespace std;

inline namespace atcoder {
    template <typename T, size_t Depth>
    struct vector_helper { using type = vector<typename vector_helper<T, Depth - 1>::type>; };
    template <typename T>
    struct vector_helper<T, 0> { using type = T; };
    template <typename T, size_t Depth>
    using vector_t = typename vector_helper<T, Depth>::type;

    template <typename T> using vec = vector_t<T, 1>;
    template <typename T> using vvec = vector_t<T, 2>;
    template <typename T> using vvvec = vector_t<T, 3>;
}

int main() {
    int n, k; cin >> n >> k;
    int ans = INT_MAX;
    for (int i = 0; i < (1 << n); ++i) {
        int a = 1;
        for (int j = 0; j < n; ++j) {
            if (i & (1 << j)) {
                a *= 2;
            }
            else {
                a += k;
            }
        }
        ans = min(ans, a);
    }
    cout << ans << endl;
}

Submission status: Runtime Error

Solution code:

n,k=map(int,input().split())
dis = 1
for i in range(n):
    if dis*2 <= dis+k:
        dis *= 2
    else:
        dis += k
print(dis)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
k = int(input())
sum_list = []
for i in range(1,n+1):
  j = n-i
  if j >= 1:
    sum_list.append((2*i)+(j+k))
sum_list.sort()
print(sum_list[0])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Min = sp.inf
for dbl in range(0, n):
    number = 1
    for i in range(dbl):
        number *= 2
    for i in range(n - dbl):
        number += k
    Min = min(Min, number)
print(Min)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;


int main(){
  
  int N,K,X;
  
  X = 1;
  
  cin >> N;
  cin >> K;
  
  for (int i = 0; i < N; i++){
    
    if(X > = K){
      X += K;
    }
    
    else{
      X += X;
    }
  }
  
  cout << X << endl;
  
}

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
x = 1

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

print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

b=2**n
ans=math.inf
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)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=1
while a<k and n:a*=2;n-=1
print(a+k*n)

Submission status: Runtime Error

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

ans=1

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 1

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

print(an

Submission status: Runtime Error

Solution code:
# 各時点で最小

N,K = map(int,input().split())

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

print(answer)

Submission status: Runtime Error

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

a=1

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

print(a)

Submission status: Runtime Error

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

a=1

for i range(n):
  if a >=k:
    a+=k
  else:
    a+=a

print(a)

Submission status: Runtime Error

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

a=1

for i range(n):
  if a >=k:
    a=+k
  else:
    a=+a

print(a)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
dp = [0] * (N+10)
dp[0] = 1
for i in range(1, N):
  dp[i] = min(d[i-1] * 2, d[i-1] + K)
print(dp[N-1])

Submission status: Runtime Error

Solution code:
xi, yi, xii, yii = map(int, input().split())
dx = xii - xi
dy = yii - yi

x = xii
y = yii
for i in range(2):
    dx, dy = -dy, dx
    x += dx
    y += dy
    print(x, y, end=' ')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def check(arr, x, y):
    d = ((0, -1), (0, 1), (1, -1), (1, 0), (1, 1), (-1, -1), (-1, 0), (-1, 1))

    if arr[x][y] == '#':
        return -1
    else:
        cnt = 0
        for dx, dy in d:
            try:
                if (x+dx) >=0 and (y+dy) >= 0:
                    if arr[x + dx][y + dy] == '#':
                        cnt += 1
            except:
                pass
    return cnt    

h, w = map(int, input().split())
s = []
for _ in range(h):
    s.append(input())
ans = []
for x in range(h):
    for y in range(w):
        val = check(s, x, y)
        if val == -1:
            ans.append('#')
        else:
            ans.append(val)

for i in range(h*w):
    print(ans[i], end="")
    if (i+1)%w == 0:
        print()

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N,K;
    cin >> N >> K;
    // 初期値とKを比較 小さい方を足す
    int num = 1;
    for (int i = 0; i < N; i++) {
        if (num <= K) {
            num *= 2;
        }
        else {
            num += K;
        }
    }
    cout << num << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
cnt=1
for i in range(N):
  if cnt <= K:
    cnt*=2
  else:
    cnt+=K
print(cnt)

Submission status: Runtime Error

Solution code:
N,K=map(int,raw_input().split())
ans=1
c=0
while c<N:
	if ans<K:
		ans=ans*2
	else:
		ans=ans+K
	c+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

compare_list = []
for i in range(N-1):
    start_num = 1
    start_num *= 2**(N-i)
    start_num += K*(i)
    compare_list.append(start_num)
    
print(min(compare_list))

Submission status: Runtime Error

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

def plus_K(x, num):
    return x + K*(num)
def multip(x, num):
    return x*(2**(num))
  
compare_dict = {}
for i in range(N-1):
    start_num = 1
    start_num = multip(start_num, i)
    start_num = plus_K(start_num, N-i)
    compare_dict[i] = start_num
    
print(min(compare_dict.values()))

Submission status: Runtime Error

Solution code:
n,k = list(map(int,input().split()))
num=1
for i in range(n):
    if  num>k:
        num+=k
    else:
        num*=2
print(num)

Submission status: Runtime Error

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

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

print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
k = int(input())
num = 2**n
list = [format(str(i),"b").zfill(n) for i in range(num)]
result = []
for i in list:
    a = 1
    for j in len(i):
        if i[j] == "0":
            a *= 2
        else:
            a += k
    result.apppend(a)
print(max(result))

Submission status: Runtime Error

Solution code:
    n = int(input())
k = int(input())
num = 2**n
list = [format(i,"b").zfill(n) for i in range(num)]
result = []
for i in list:
    a = 1
    for j in range(len(i)):
        if i[j] == "0":
            a *= 2
        else:
            a += k
    result.append(a)
print(min(result))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
k = (int(input()))
a = [(1<<x)+k*(n-x) for x in range(1,n)]
print(min(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in N:
    if number * 2 < number + K:
        number = number * 2
    else:
        number = number + K

print(number)

Submission status: Runtime Error

Solution code:
def B_Addition_and_Multiplication(N, K):
  	if N==1:
      return 2
    multiply = 0  # 掛け算する回数
    add = 0  # 足し算する回数
    tmp = 1
    while tmp < K:
        tmp *= 2
        multiply += 1
    add = N - multiply

    ans = pow(2, multiply) + K * add
    return ans
  
N = int(input())
K = int(input())
print(B_Addition_and_Multiplication(N, K))

Submission status: Runtime Error

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)