qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import math
x = int(input())
int(math.sqrt(x))**2

Fixed code:
import math
x = int(input())
print(int(math.sqrt(x))**2)
Buggy code:
n = int(input())

ans = 0
for i in reversed(range(n)):
    if i**(0.5)%1 == 0:
        ans = i
        break
print(ans)

Fixed code:
n = int(input())

ans = 0
for i in reversed(range(n+1)):
    if i**(0.5)%1 == 0:
        ans = i
        break
print(ans)
Buggy code:
n=int(input())
i=1
while True:
    if i**2>=n:
        print((i-1)**2)
        break
    i+=1

Fixed code:
n = int(input())
i = 1
while True:
    if i ** 2 > n:
        print((i-1)**2)
        break
    i += 1
Buggy code:
print(int(int(input())*0.5)**2)

Fixed code:
print(int(int(input())**0.5)**2)
Buggy code:
N = int(input())
ans = 0
for i in range(1,N+1):
    if i*i <= N:
        ans = max(ans,i*i)
    #else:
        #break
print(ans)

Fixed code:
N = int(input())
ans = 0
for i in range(1,N+1):
    if i*i <= N:
        ans = max(ans,i*i)
    else:
        break
print(ans)
Buggy code:
n = int(input())

for i in range(0,10**9,1):
    a = i ** 2
    if a >= n:
        break
print((i - 1) ** 2)

Fixed code:
n = int(input())

for i in range(0,10 ** 9 + 1,1):
    a = i ** 2
    if a > n:
        break
print((i - 1) ** 2)
Buggy code:
n=int(input())
x=n**0.5
print(int(n)**2)

Fixed code:
n = int(input())
print(int(n**(0.5))**2)
Buggy code:
# coding: utf-8
import time
import re
import math

def main():
    n=int(input())
    print(math.pow(math.floor(math.sqrt(n)),2))
main()

Fixed code:
# coding: utf-8
import time
import re
import math

def main():
    n=int(input())
    print(int(math.pow(math.floor(math.sqrt(n)),2)))
main()
Buggy code:
n=int(input())
i=1
while i*i<=n:
    i+=1
print(i*i)


Fixed code:
n=int(input())
i=1
while i*i<=n:
    i+=1
print((i-1)*(i-1))
Buggy code:
n=int(input())
t=1
while t*t<n:
  t+=1
print(t-1)

Fixed code:
n=int(input())
t=1
while t*t<=n:
  t+=1
print((t-1)**2)
Buggy code:
n = int(input())
ans = 1
while ans**2 <= n:
    if ans**2 < n: ans += 1
print((ans-1)**2)


Fixed code:
n = int(input())
ans = 1
while ans*ans <= n:
    ans += 1
print((ans-1)**2)
Buggy code:
n = int(input())
import math as m
x = m.sqrt(n)
while x > n :
    x = x - 1
    
print(x*x)

Fixed code:
n = int(input())
import math as m
x = round(m.sqrt(n)) + 1
while x > m.sqrt(n) :
    x = x - 1
    
print(x*x)
Buggy code:
n=int(input())
for i in range(1,10**3+2):
  if i**2>n:print((i-1)**2);exit()


Fixed code:
n=int(input())
for i in range(1,10**5+2):
  if i**2>n:print((i-1)**2);exit()
Buggy code:
n = int(input())
i = 1
while i**2 < n:
    i += 1
print((i-1)**2)


Fixed code:
n = int(input())
i = 1
while i**2 <= n:
    i += 1
print((i-1)**2)
Buggy code:
N = int(math.sqrt(int(input())))

print(N*N)

Fixed code:
import math
N = int(math.sqrt(int(input())))
print(N*N)
Buggy code:
n = int(input())
print(int((n**.5)**2)

Fixed code:
n = int(input())

print((int(n ** 0.5)) ** 2)
Buggy code:
x = int(input())
print((int(x ** 0.5)))

Fixed code:
x = int(input())
print((int(x ** 0.5)) ** 2)
Buggy code:
import bisect
n = int(input())
li = []
for i in range(10000):
    li.append(i**2)
a = bisect.bisect_right(li, n)
print(li[a-1])

Fixed code:
import bisect
n = int(input())
li = []
for i in range(100000):
    li.append(i**2)
a = bisect.bisect_right(li, n)
print(li[a-1])
Buggy code:
n=int(input())
i=1
while i**2<n:
  i+=1
print(i**2)

Fixed code:
n=int(input())
i=1
while i**2<=n:
  i+=1
print((i-1)**2)
Buggy code:
N = int(input())
X = int(N ** 0.5)
print(X *2)

Fixed code:
N = int( input() )

print( int(N**0.5)**2 )
Buggy code:
N = int( input() )

for i in range( int(N**0.5)+1 ):
    ans = max( ans, i*i )

print( ans )

Fixed code:
N = int( input() )

ans = 0
for i in range( int(N**0.5)+1 ):
    ans = max( ans, i*i )

print( ans )
Buggy code:
N = int(input())

print(int(10**(0.5)**2))

Fixed code:
N = int(input())

print(int(N**(0.5))**2)
Buggy code:
import math
a=int(input())
print(math.floor(a**0.5))

Fixed code:
import math
a=int(input())
print((math.floor(a**0.5))**2)
Buggy code:
n = int(input())

before_square = 1
while before_square**2 < n:
    before_square += 1
before_square -= 1

print(before_square**2)

Fixed code:
n = int(input())

before_square = 1
while before_square**2 <= n:
    before_square += 1
before_square -= 1

print(before_square**2)
Buggy code:
n = int(input())

i = 1
while i * i <= n:
  i += 1

print(i - 1)

Fixed code:
n = int(input())

i = 1
while i * i <= n:
  i += 1

print((i - 1) ** 2)
Buggy code:
import math
N = int(input())
ans = 1
for i in range(10**5):
    if i**2 < N:
        ans = i**2
    if i**2 > N:
        break

print(ans)


Fixed code:
import math
N = int(input())
ans = 1
for i in range(10**5):
    if i**2 <= N:
        ans = i**2
    if i**2 > N:
        break

print(ans)
Buggy code:
n=int(input())
for i in range(1,40000):
  if i*i>n:
  　print(i-1)
    break


Fixed code:
n=int(input())
for i in range(1,40000):
  if i**2>n:
    print((i-1)**2)
    break
Buggy code:
a = int(input())
import math
def Bround(a):
    while True:
        s = math.sqrt(a)
        if s * s == a:
            return a
        else:
            a -= 1
print(Bround(a))

Fixed code:

a = int(input())
import math
def Bround(a):
    while True:
        s = math.floor(math.sqrt(a))
        if s * s == a:
            return a
        else:
            a -= 1
print(Bround(a))
Buggy code:
def newrating(r , g):

    return (g - r) * 2

def main():
    r = int(input())
    g = int(input())
    print(newrating(r , g))

if __name__ == '__main__':
    main()

Fixed code:
def main():
    r, g = int(input()), int(input())

    print(2 * g - r)


if __name__ == "__main__":
    main()
Buggy code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

R, G = iInM()
ans = 2 * G - R
print(ans)

Fixed code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

R = iIn()
G = iIn()

ans = 2 * G - R
print(ans)
Buggy code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

R = i()
G = i()print(R+(G-R)*2)

Fixed code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

R = i()
G = i()
print(R+(G-R)*2)
Buggy code:
R = int(input())
G = int(input())

sa = R-G
print(G+sa)


Fixed code:
R = int(input())
G = int(input())

sa = G-R
print(G+sa)
Buggy code:
R=input()
G=input()
N=2*G-R
print(N)

Fixed code:
R = int(input())
G = int(input())


N = 2*G -R

print(N)
Buggy code:
r=int(input())
g=int(input())
ans=g-r
print(ans)

Fixed code:
r = int(input())
g = int(input())
ans = (g - r) + g
print(ans)
Buggy code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

r, g = [int(readline()) for _ in range(2)]
ans = r + (g - r) * 2
print(r, (g - r), (g - r) * 2)

Fixed code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

r, g = [int(readline()) for _ in range(2)]
ans = r + (g - r) * 2
print(ans)
Buggy code:
now_rate = int(input())
to_rate = int(input())

print(abs(now_rate - to_rate * 2))

Fixed code:
now_rate = int(input())
to_rate = int(input())

print(to_rate * 2 - now_rate)
Buggy code:
r,g=list(map(int,input().split()))
print(2*g-r)

Fixed code:
r = int(input())
g = int(input())
#  =map(int,input().split())
#  =list(map(int,input().split()))
print(g*2-r)
Buggy code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    R = float(sys.stdin.readline().rstrip())
    G = float(sys.stdin.readline().rstrip())
    print(R+(G-R)*2)


if __name__ == '__main__':
    main()


Fixed code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    R = float(sys.stdin.readline().rstrip())
    G = float(sys.stdin.readline().rstrip())
    print(int(R+(G-R)*2))


if __name__ == '__main__':
    main()
Buggy code:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B = read().decode('utf8').split()
print(2*B-A)


Fixed code:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B = map(int,read().decode('utf8').split())
print(2*B-A)
Buggy code:


import numpy as np

r=int(input())
g=int(input())
print(2*r-g)

Fixed code:


import numpy as np

r=int(input())
g=int(input())
print(2*g-r)
Buggy code:
r = int(input())
g = int(input())

if r<g:
  print(2*abs(r-g)+r)
elif r>g:
  print(2*abs(r-g)-r)
else:
  print(r)


Fixed code:
r = int(input())
g = int(input())

if r<g:
  print(r+2*abs(r-g))
elif r>g:
  print(r-2*abs(r-g))
else:
  print(r)
Buggy code:
def resolve():
    r = int(input())
    g = int(input())
    print((g - r) * 2)


if __name__ == "__main__":
    resolve()


Fixed code:
def resolve():
    r = int(input())
    g = int(input())
    print(2 * g - r)


if __name__ == "__main__":
    resolve()
Buggy code:
r = float(input())
g = float(input())


print(g*2 - r)

Fixed code:
r=float(input())
g=float(input())
print(int(2*g-r))
Buggy code:
R,G = map(int,open(0).read().split())
print(3*R-2*G)


Fixed code:
R,G = map(int,open(0).read().split())
print(2*G-R)
Buggy code:
print(-2*int(input())+int(input()))


Fixed code:
print(-int(input())+int(input())*2)
Buggy code:
print(2*int(input())-int(input()))

Fixed code:
print(-(int(input())-int(input())*2))
Buggy code:
R = int(input())
G = int(input())

print(R+(G-R)**2)

Fixed code:
R = int(input())
G = int(input())
X = (G -R) * 2
print(R + X)
Buggy code:
def rating_goal(R: float, G: float)->float:
    return 2*G - R


if __name__ == "__main__":
    R = float(input())
    G = float(input())
    ans = rating_goal(R, G)
    print(ans)


Fixed code:
def rating_goal(R: float, G: float)->float:
    return 2*G - R


if __name__ == "__main__":
    R = int(input())
    G = int(input())
    ans = rating_goal(R, G)
    print(ans)
Buggy code:
r,g = [int(input()) for i in range(2)]

print(g * 2 + r)

Fixed code:
r,g=[int(input()) for i in range(2)]
print(r+(g-r)*2)
Buggy code:
def solve(a,b):
    return b+(b-a)

def readQuestion():
    a = sys.stdin.readline().strip()
    b = sys.stdin.readline().strip()
    
    return (int(a),int(b))

def main():
    a ,b  = readQuestion()
    answer = solve(a ,b)
    print(answer)

#if __name__ == '__main__':
#    main()


Fixed code:
import sys

def solve(a,b):
    return b+(b-a)

def readQuestion():
    a = sys.stdin.readline().strip()
    b = sys.stdin.readline().strip()
    
    return (int(a),int(b))

def main():
    a ,b  = readQuestion()
    answer = solve(a ,b)
    print(answer)

if __name__ == '__main__':
    main()
Buggy code:
# -*- coding: utf-8 -*-


a=input()
b=input()

s=2*b-a

print(s)



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

a=int(input())
b=int(input())

s=2*b-a

print(s)
Buggy code:
a = int(input())
b = int(input())
print(b + (a - b))

Fixed code:
a=int(input());b=int(input());print(b+b-a)
Buggy code:
x = int(input())
y = int(input())
print(y**2-x)


Fixed code:
x=int(input())
y=int(input())
#print(x)
#print(y)
print(2*y-x)
Buggy code:
hoge=[]
for i in range(0,1):
  a=int(input())
  hoge.append(a)
R=hoge[0]
G=hoge[1]
print(2*G-R)

Fixed code:
a = []
for i in range(2):
    a.append(input()) 
R=int(a[0])
G=int(a[1])
print(2*G-R)
Buggy code:
r = int(input());g = int(input());print(2*G-r)

Fixed code:
r = int(input());g = int(input());print(2*g-r)
Buggy code:
R=int(input())
print((int(input())*2-R)

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

print(2*N-R)
Buggy code:
a=int(input())
b=int(input())
c=a-b
print(b+c)

Fixed code:
a=int(input())
b=int(input())
c=b-a
print(b+c)
Buggy code:
r=int(input())
g=int(input())
print((g-r)*2+g)

Fixed code:
r, g = int(input()), int(input())

print(r+(g-r)*2)
Buggy code:
R = int(input(())
B = int(input())
print(2 * B - R)

Fixed code:
R = int(input())
B = int(input())
print(2 * B - R)
Buggy code:
r,g=[int(input()) for i range(2)]
print(g*2-r)

Fixed code:
r, g = [int(input()) for i in range(2)]
print(2 * g - r)
Buggy code:
r=input()
g=input()
a=2*g-r
print(a)

Fixed code:
r=int(input())
g=int(input())
a=2*g-r
print(a)
Buggy code:
pres_rate = input()
goal_rate = input()
next_rate = goal_rate * 2 - pres_rate
print(next_rate)


Fixed code:
pres_rate = int(input())
goal_rate = int(input())
next_rate = goal_rate * 2 - pres_rate
print(next_rate)
Buggy code:
r = int(input())
g = int(input())
print(g*2-a)

Fixed code:
r = int(input())
a = int(input())
print(a*2-r)
Buggy code:
i,p=int,input
print(2*(i(p())-i(p())))

Fixed code:
i,p=int,input
print(-i(p())+2*i(p()))
Buggy code:
a = int(input())
b = int(input())
print(2*c-a)

Fixed code:
b = int(input())
c = int(input())
print(2*c-b)
Buggy code:
R = int(input())
G = int(input())

W = R + R - G

print(W)

Fixed code:
R = int(input())
G = int(input())

print(G+(G-R))
Buggy code:
R = int.input()
G = int.input()
ans = 2 * G - R
print(ans)

Fixed code:
R = int(input())
G = int(input())
ans = G*2 -R
print(ans)
Buggy code:
R = int(input())
G = int(input())
ans = G * 2 + R
print(ans)

Fixed code:
R=int(input())
G=int(input())

ans=R+(G-R)*2

print(ans)
Buggy code:
r = int(input())
g = int(input())

print(g + abs(g-r))

Fixed code:
r = int(input())
g = int(input())
print(g + (g - r))
Buggy code:
R = int(input())
G = int(input())

print(G - 2*R)

Fixed code:
R = int(input())
G = int(input())

b = 2*G - R
print(b)
Buggy code:
g=int(input())
r=int(input())
print(2*g-r)

Fixed code:
r = int(input())
g = int(input())
ans = g*2 - r
print(ans)
Buggy code:
A = int(input())
B = int(input())
print(B*2-A))


Fixed code:
A = int(input())
B = int(input())

Result = B*2-A
print(Result)
Buggy code:
r = int(input())
g = int(input())

print(r+2*g)

Fixed code:
r = int(input())
g = int(input())
print(r+(g-r)*2)
Buggy code:
R=input()
G=input()
print(2*G-R)

Fixed code:
R = int(input())
G= int(input())
print(2*G-R)
Buggy code:
a=int(input())
b=int(input())
print(b-2*a)

Fixed code:
a=int(input())
b=int(input())

print(a+2*(b-a))
Buggy code:
n = int(input())
k = int(input())
s = 1
while n > 0:
  if s < k:
    s = s*2
  else:
    s += k
print(s)

Fixed code:
n = int(input())
k = int(input())
s = 1
while n > 0:
  if s < k:
    s = s*2
  else:
    s += k
  n -= 1
print(s)
Buggy 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)

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

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

print(ans)
Buggy code:
def bin(a):
  return 2*a

def ten(a):
  return a+10

N = int(input())
K = int(input())
value = 1
for i in range(N):
  if bin(value) <= ten(value) :
    value = bin(value)
  else:
    value = ten(value)
print(value)

Fixed code:
def bin(a):
  return 2*a

def ten(a):
  return a+K

N = int(input())
K = int(input())
value = 1
for i in range(N):
  if bin(value) <= ten(value) :
    value = bin(value)
  else:
    value = ten(value)
print(value)
Buggy 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])

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

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

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

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

Fixed code:
N = int(input())
K = int(input())
a = 1
for _ in range(N):
    a = min(a*2, a+K)
print(a)
Buggy code:
n = int(input())
k = int(input())
num = 2**k
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))

Fixed 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(n):
        if i[j] == "0":
            a *= 2
        else:
            a += k
    result.append(a)
print(min(result))
Buggy 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)
  




Fixed code:
n = int(input())
k = int(input())
a = 1
for i in range(n):
    if 2*a>=a+k:
        a = a+k
    else:
        a = 2*a
print(a)
Buggy code:
N = int(input())
K = int(input())
now = 1
for i in range(N):
  if now <= K:
    now += 2
  else:
    now += K
print(ans)

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


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

Fixed code:
n = int(input())
k = int(input())
s = 1
for i in range(n):
    if 2 * s < s + k:
        s += s
    else:
        s += k
print(s)
Buggy code:
N = int(input())
K = int(input())
ans = 1
for i in range(N):
    ans = min(ans+K,2*ans)
print(min)

Fixed code:
N = int(input())
K = int(input())
ans = 1
for i in range(N):
    ans = min(ans+K,2*ans)
print(ans)
Buggy 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)

Fixed 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)
Buggy code:
n=int(input());k=int(input()),r=1
for _ in[0]*n:r+=min(r,k)
print(r)

Fixed code:
n=int(input());k=int(input());r=1
for _ in[0]*n:r+=min(r,k)
print(r)
Buggy code:
n=int(input())
k=int(input())
ans=1
for i in range(n):
  ans=max(ans+k,ans*2)
print(ans)
  

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

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

print(ans)
Buggy 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)

Fixed code:
N = int(input())
K = int(input())
 
ans = 1000000
 
for bi in range(1<<N):
  cnt = 1
  for i in range(N):
    if bi>>i&1:
      cnt *= 2
    else:
      cnt += K
  ans = min(ans, cnt)
print(ans)
Buggy code:
N = int(input())
K = int(input())
ans = 1
for i in range(N):
  ans += min(K, ans*2)
print(ans)

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

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

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

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

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

Fixed code:
n,k = int(input()),int(input())
ans = 1
for i in range(n):
  ans = min(ans*2, ans+k)
print(ans)
Buggy 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()

Fixed 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()
Buggy code:
N = int(input())
K = int(input())

ans = 1

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

print(an

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

ans = 1

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

print(ans)
Buggy 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)

Fixed code:
n=int(input())
k=int(input())
s=1
for i in range(n):
  if (s*2)-s<=k:
    s=s*2
  else:
    s+=k
print(s)
Buggy code:
N = int(input())
K = int(input())
x = 1
for i in range(N):
  if 2 * x < K:
    x *= 2
  else:
    x += K

print(x)

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

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

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