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: Wrong Answer

Solution code:
def main():
    n, k = int(input()), int(input())
    cnt = 0
    x = 1

    while True:
        x *= 2
        cnt += 1
        if x > k:
            break

    print(x + k * (n - cnt))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

ans = 1
count = 0
num1 = int(input())
num2 = int(input())
for i in range(num1):
    if ans < num1:
        ans *= 2
    else:
        ans += num2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


for i in range(1,count+1):
    x_a = a*2
    x_b = a + k
    
    if i < k:
        a = x_a
    else:
        a = x_b
    #インデントが正しくないので、何度も出力されています。
#    print(a)
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
 
num = 1
count = 0
 
while num < k:
    num *= 2
    count += 1
    
while count < n:
  num += k
  count += 1
  
print(num)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
 
num = 1
count = 0
 
while num <= k:
    num *= 2
    count += 1
    
while count < n:
  num += k
  count += 1
  
print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = 1
count = 0

while num < k:
    num *= 2
    count += 1
    
num + (k * (n-count))

print(num)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
ans=1000
for i in range(N):
    num=1
    for s in range(i):
        num = num*2
    
    for t in range(N-i):
        num += K
    
    if num < ans:
        ans = num

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
ans = 2**n + k*n
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
mini = 1025
N = int(input())
K = int(input())
for i in range(N+1):
  x = 1
  xx = 2**i
  xxx = K*(N-i) +xx
  print(xxx)
  if xxx < mini:
    mini = xxx
print(mini)

Submission status: Wrong Answer

Solution code:
mini = 1025
N = int(input())
K = int(input())
for i in range(N+1):
  x = 1
  xx = 2**i
  xxx = K*(4-i) +xx
  
  if xxx < mini:
    mini = xxx
print(mini)

Submission status: Wrong Answer

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

ans = 1000000

for bi in range(1<<N):
  cnt = 0
  for i in range(N):
    if bi>>i&1:
      cnt *= 2
    else:
      cnt += K
  ans = min(ans, cnt)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
A = 0
if K ** 0.5.is_integer():
    A = int(K ** 0.5) + 1
else:
    A = int(K ** 0.5)
print(2 ** A + K * (N - A))

Submission status: Wrong Answer

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

i = 0
ans = 1
while True:
    print(ans)
    if i == N:
        break
    if ans < K:
        ans *= 2
        i += 1
    else:
        ans += K
        i += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
print(2**min(n, 3)+10*(max(0, n-3)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 1
cnt = n
while ans < k:
    ans *= 2
    cnt -= 1
    if cnt == 1:
        break

ans += cnt * k
print(ans)

Submission status: Wrong Answer

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

ans = 1
cnt = n
while ans <= k:
    ans *= 2
    cnt -= 1
    if cnt == 1:
        break

ans += cnt * k
print(ans)

Submission status: Wrong Answer

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

ans = 1
cnt = n
while ans <= k:
    ans *= 2
    cnt -= 1
    if cnt == 1:
        break

print(ans)

ans += cnt * k
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
print(min((N//2)*2+(N-N//2)*K,(N-N//2)*2+(N//2)*K))

Submission status: Wrong Answer

Solution code:
s = input()[::-1]
t = input()[::-1]

for i in range(len(s) - len(t) + 1):
    check = True
    for j in range(len(t)):
        if s[i+j] == t[j]:
            pass
        elif s[i+j] == "?":
            pass
        else:
            check = False
            break
        
    if check:
        s = list(s)
        t = list(t)
        s[i:i+len(t)] = t
        s = "".join(s)
        s = s.replace("?","a",50)
        print(s[::-1])
        exit()
            
print("UNRESTORABLE")

Submission status: Wrong Answer

Solution code:
from math import ceil, log2
n = int(input())
k = int(input())
temp = ceil(log2(k))
print(2 ** temp + k * (n - temp))

Submission status: Wrong Answer

Solution code:
from math import log2
n = int(input())
k = int(input())
temp = int(log2(k)) + 1
print(2 ** temp + k * (n - temp))

Submission status: Wrong Answer

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: Wrong Answer

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

ans = 1

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

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
ans=[]
for i in range(N):
    ans.append((i+1)*2+(N-i-1)*K)
print(min(ans))

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
ans=[]
for i in range(N):
    ans.append((i+1)*2+(N-i-1))
print(min(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
a=1
b=0
while k>a and b<=n:
    a=a*2
    b+=1
for i in range(n-b):
    a+=k
print(a)

Submission status: Wrong Answer

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

ans = 1

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

Submission status: Wrong Answer

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

ans = 1
while ans < k:
    ans *= 2
    n -= 1

ans += n * k
print(ans)

Submission status: Wrong Answer

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

ans = 1
while ans <= k:
    ans *= 2
    n -= 1

ans += n * k
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    n = int(input())
    K = int(input())
    i = 1
    cnt = 0
    while i <= K:
        i *= 2
        cnt += 1
    print(i+K*(n-cnt))


resolve()

Submission status: Wrong Answer

Solution code:
import unittest
from io import StringIO
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    n = int(input())
    K = int(input())
    i = 1
    cnt = 0
    while i <= K:
        i *= 2
        cnt += 1
    print(i+K*(n-cnt))


resolve()

Submission status: Wrong Answer

Solution code:

def resolve():
    n = int(input())
    K = int(input())
    i = 1
    cnt = 0
    while i <= K:
        i *= 2
        cnt += 1
    print(i+K*(n-cnt))


resolve()

Submission status: Wrong Answer

Solution code:
import unittest
from io import StringIO
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    n = int(input())
    K = int(input())
    i = 1
    cnt = 0
    while i <= K:
        i *= 2
        cnt += 1
    print(i+K*(n-cnt))


resolve()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    K=int(input())
    i=1
    cnt=0
    while i<K:
        i*=2
        cnt+=1
    print(i+K*(n-cnt))

    
resolve()

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
k = int(input())

Min = np.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: Wrong Answer

Solution code:
N=int(input())
K=int(input())
board=[]
for i in range(N+1):
    num=1
    num=num*(2**i)
    num+=K*(N-i)
    print(num)
    board.append(num)
print(min(board))

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
board=[]
for i in range(N):
    num=1
    num=num*(2**i)
    num+=K*(N-i)
    board.append(num)
print(min(board))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
k=int(input())
print(2**(int(math.log2(k))+1)+k*(n-(int(math.log2(k))+1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
ans=1
cnt=0
while cnt<=a:
    if ans>b:
        break
    ans=ans*2
    cnt+=1
if cnt<a:
    ans=ans+((a-cnt)*b)
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
ans=1
cnt=0
while cnt<=a:
    if ans>b:
        break
    ans=ans*2
    cnt+=1
ans=ans+((a-cnt)*b)
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, k, w = int(input()), int(input()), 1
while w <= k:
    w *= 2
    n -= 1
print(w + k*n)

Submission status: Wrong Answer

Solution code:
n, k, w = int(input()), int(input()), 1
while w < k:
    w *= 2
    n -= 1
print(w + k*n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
t = 0
while 1:
    if 2**t < K:
        t += 1
    else:
        break
print(2**t+K*(N-t))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
tmp = K
t = 0
while tmp > 0:
    t += 1
    tmp //= 2

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
x = 1
  
a = 0
while 2**a <= K:
  a += 1

for i in range(a):
  x = x*2
for i in range(N-a):
  x = x + K

print(x)

Submission status: Wrong Answer

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

def func(a):
  ans = 1
  for n in range(a):
    ans = ans*2
  if a < N:
    for n in range(N-a):
      ans = ans + K
  return ans

print(min([func(i) for i in range(N)]))

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
res=1
cnt=0
while(res<K):
    res*=2
    cnt+=1
while(cnt<N):
    res+=K
    cnt+=1
print(res)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
res=1
cnt=0
while(res<K):
    res*=2
    cnt+=1
while(cnt<N):
    res+=K
    cnt+=1
print(res)
print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=int(input())
res=1
cnt=0
while(res<=K):
    res*=2
    cnt+=1
res+=K*max(0,N-cnt)
print(res)

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def doubleork(n, k):

    ans = 1

    for i in range(n):
        if ans * 2 < 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: Wrong Answer

Solution code:
import math
N = int(input())
n = N
amari = 0
for i in range (len(str(N))):
  amari += n % 10
  n = math.floor(n / 10)
if N % amari == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
if 1 <= k < 2:
    print(k*n)
elif 2 <= k < 4:
    print(4 + k*(n-2))
elif 4 <= k < 8:
    print(8 + k*(n-3))
elif 8 <= k <= 10:
    print(16 + k*(n-4))

Submission status: Wrong Answer

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

d = 1

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

print(d)

Submission status: Wrong Answer

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

d = 1

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

print(d)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
import math

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

i = math.ceil(math.log(K, 2))
ans = 2 ** i + (N - i) * K

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = int(log(k, 2))
print(2 ** (a + 1) + (n - a - 1) * k)

Submission status: Wrong Answer

Solution code:
n=input().rstrip()
k=input().rstrip()
n,k=int(n),int(k)
a=0
q=0
kaisu=0
while q<n:
    kaisu+=2**q
    q+=1
while a<=kaisu:
    monitor=1
    h=0
    d=bin(a)
    d=d[2:]
    c=str(d)
    l=len(c)
    while h<n-l:
        monitor=monitor*2
        h+=1
    h=0
    while h<l:
        if c[h]==0:
            monitor=monitor*2
        else:
            monitor+=k
        h+=1
    if a==0:
        shinmonitor=monitor
    elif monitor<shinmonitor:
        shinmonitor=monitor
    a+=1
print(shinmonitor)

Submission status: Wrong Answer

Solution code:
n=input().rstrip() #全文字数でlより自明に長い
k=input().rstrip()
n,k=int(n),int(k)
a=0
q=0
kaisu=0
while q<n:
    kaisu+=2**q
    q+=1
while a<=kaisu:
    monitor=1
    h=0
    d=bin(a)
    d=d[2:]
    c=str(d)
    l=len(c) #2進数の文字数
    while h<n-l:
        monitor=monitor*2
        h+=1
    h=0
    while h<l:
        if c[h]==0:
            monitor=monitor*2
        else:
            monitor+=k
        h+=1
    if a==0:
        shinmonitor=monitor
    elif monitor<shinmonitor:
        shinmonitor=monitor
    a+=1
print(shinmonitor)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
c = 1
while c < k:
    c*=2
    n-=1

print(c+k*n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
odd = list(input())
even = list(input())+[""]
r = ""
for o, e in zip(odd, even):
  r += o+e
print(r)

Submission status: Wrong Answer

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

ans=2**N

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(i + (n-j)*k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k = [int(input()) for i in range(2)]
m = 0
while k > 2**m:
    m += 1

print(min(2**m + (n-m)*k,2**n,k*n+1))

Submission status: Wrong Answer

Solution code:
n,k = [int(input()) for i in range(2)]
m = 0
while k > 2**m:
    m += 1

print(min(2**m + (n-m)*k,2**n,k*n))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# これくらい小さい数だと素直にループした方が早いとは思う

import math

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

border_index = math.ceil(math.log2(k))

print(2 ** border_index + k * (n - border_index))

Submission status: Wrong Answer

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

max = 0
maxcounter = 0
j = 1

for i in range(N):
  # counter = 0
  # while j > 1:
  if j * 2 <= j + R:
    j = j * 2
    # counter += 1
  else:
    j = j + R

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC076b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

ans = 10**4

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
input=sys.stdin.readline

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

x = 1
while x < k:
    x *= 2
    n -= 1
for i in range(n):
    x += k
print(x)

Submission status: Wrong Answer

Solution code:
S = input()

if S == "a":
  print(-1)
else:
  print("a")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
l = len(bin(k))
print(2**(l-2)+k*(n-l+2))

Submission status: Wrong Answer

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

if k == 1:
    print(n + 1)
else:
    i = 0
    a = 1
    while a < k:
        a *= 2
        i += 1
    print(a + k * (n - i))

Submission status: Wrong Answer

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

if k == 1:
    print(n + 1)
else:
    i = 0
    a = 1
    while a <= k:
        a *= 2
        i += 1
    print(a + k * (n - i))

Submission status: Wrong Answer

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

if k == 1:
    print(k + 1)
else:
    i = 0
    a = 1
    while a <= k:
        a *= 2
        i += 1
    print(a + k * (n - i))

Submission status: Wrong Answer

Solution code:
# ABC076-B
N = int(input())
K = int(input())
ans_list = []
for a in range(N+1):
    tmp = 1
    b = N - a
    for i in range(a):
        tmp  *= 2
    tmp += b * K
    ans_list.append(tmp)
print(ans_list)    
print(min(ans_list))

Submission status: Wrong Answer

Solution code:
# ABC076-B
N = int(input())
K = int(input())
ans_list = []
for a in range(N):
    tmp = 1
    b = N - a
    for i in range(a):
        tmp  *= 2
    tmp += b * K
    ans_list.append(tmp)
    
print(min(ans_list))

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
k = int(input())
tmp = []

for i in range(n):
  x = 1
  x = x * (2**i)
  x = x + (n-i)*k
  tmp.append(x)
print(min(tmp))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n):
    num=1
    j = n-i
    
    for x in range(i):
        num *= 2
    num += k*j
    
    if i==0:
        ans = num
    elif num < ans:
        ans = num

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=int(input())
t=[]
l=[1,2,4,8,16]
for i in range(5):
    if l[i]<k:
        t.append(i)
a=len(t)
b=n-a

print(2**a+k*b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
K=int(stdin.readline().rstrip())
num = 1
cnt = 0
while num < N:
    num = num * 2
    cnt += 1
for _ in range(N-cnt):
    num += K
print(num)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
K=int(stdin.readline().rstrip())
num = 1
cnt = 0
while num < K:
    num = num * 2
    cnt += 1
for _ in range(N-cnt):
    num += K
print(num)

Submission status: Wrong Answer

Solution code:
import math

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

twice_count = int(math.log2(K)) + 1
print(2**twice_count + K*(N - twice_count))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a=1

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

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 1
cnt = 0
while ans <= k:
    cnt += 1
    ans *= 2
ans += (n - cnt) * k
print(ans)

Submission status: Wrong Answer

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

ans = 1
cnt = 0
while ans < k:
    cnt += 1
    ans *= 2
ans += (n - cnt) * k
print(ans)

Submission status: Wrong Answer

Solution code:
def addition_and_multiplication(N: int, K: int)->int:
    min_d = float('inf')
    for i in range(1 << N):
        d = 1
        # i のビットが立っているところでは 2 倍にする。
        # それ以外では K をたす。
        for _ in range(N):
            if i & 1:
                d = d * 2
            else:
                d = d + K
        min_d = min(d, min_d)
    return min_d


if __name__ == "__main__":
    N = int(input())
    K = int(input())
    ans = addition_and_multiplication(N, K)
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
ans = 1
for i in range(20):
  if ans >= k:
    break
  ans *= 2
  n -= 1

print(ans + k*n)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
ans = 1
for i in range(10):
  ans *= 2
  n -= 1
  if ans >= k:
    break
print(ans + k*n)

Submission status: Wrong Answer

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

ans = 1
while ans <= k :
    ans *= 2
    n -= 1
print(ans + k * n)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
l = []
m = []
for i in range(1,n+1):
    l.append(2**(i-1))
    m.append(i*k - 2)
    if 2**i - 2**(i-1) > k:
        print(2**(i-1) + k*(n-i+1))
        break

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
l = []
m = []
for i in range(1,n+1):
    l.append(2**(i-1))
    m.append(i*k - 2)
    if 2**i - 2**(i-1) > k:
        print(2**(i-1) + k*(n-i+1))
        break
    elif k == 1:
        print(n+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 1
count = 0
while ans <= k:
    ans *= 2
    count += 1
    
print((n - count) * k + ans)

Submission status: Wrong Answer

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

ans = 1
count = 0
while ans < k:
    ans *= 2
    count += 1
    
print((n - count) * k + ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
p=len(format(b,"b"))
print(2**p+b*(max(a-p,0)))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
p=len(format(b,"2"))
print(2**p+b*(max(a-p,0)))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
i = 1
j = 1
while j < K:
    i = i+1
    j = j*2

j
for k in range(N-i+1):
    j  += K

print(j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 1
ncount = 0
for i in range(1, n):
  ans *= 2
  ncount += 1
  if ans > k:
    break

nrest = n - ncount
for j in range(1, nrest + 1):
  ans += k
  
print(ans)

Submission status: Wrong Answer

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


def main():
    """Function."""
    n = int(input())
    k = int(input())

    flag = 0
    temp = 1
    for _ in range(n):
        print(_, temp)
        if flag == 0:
            if temp < k:
                temp = temp * 2
            else:
                temp += k
                flag = 1

        elif flag == 1:
            temp += k
    print(temp)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
p = 1
ct = 0
while(p < K and ct <= N):
    p *= 2
    ct += 1
print(p + (max(0, N-ct) * K))

Submission status: Wrong Answer

Solution code:
import math


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

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

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

Submission status: Wrong Answer

Solution code:
import math


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

A = math.ceil(math.log2(K))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

c = 1
n = 0
while True:
    if c * 2 <= c + K:
        c = c * 2
        n = n + 1
    else:
        break

for i in range(n, N):
    c = c + K

print(c)

Submission status: Wrong Answer

Solution code:
import math
n= int(input());k=int(input())
tim = math.ceil(math.log2(k))
print(2**tim + (n-tim)*k)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
ans = 1
cnt = 0
while ans < k:
    ans *= 2
    cnt += 1

while cnt < n:
    ans += k
    cnt += 1

print(ans)