Problem:
 Score : 400 points    Problem Statement Snuke has one biscuit and zero Japanese yen (the currency) in his pocket.
He will perform the following operations exactly K times in total, in the order he likes:   Hit his pocket, which magically increases the number of biscuits by one.  Exchange A biscuits to 1 yen.  Exchange 1 yen to B biscuits.   Find the maximum possible number of biscuits in Snuke's pocket after K operations.      Constraints  1 \leq K,A,B \leq 10^9  K,A and B are integers.         Input Input is given from Standard Input in the following format:  K  A  B       Output Print the maximum possible number of biscuits in Snuke's pocket after K operations.        Sample Input 1 4 2 6      Sample Output 1 7  The number of biscuits in Snuke's pocket after K operations is maximized as follows:   Hit his pocket. Now he has 2 biscuits and 0 yen.  Exchange 2 biscuits to 1 yen. his pocket. Now he has 0 biscuits and 1 yen.  Hit his pocket. Now he has 1 biscuits and 1 yen.  Exchange 1 yen to 6 biscuits. his pocket. Now he has 7 biscuits and 0 yen.        Sample Input 2 7 3 4      Sample Output 2 8       Sample Input 3 314159265 35897932 384626433      Sample Output 3 48518828981938099

Solution (Python):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())



k,a,b = (int(i) for i in input().split())    







left = 0
s = 0
if a >= b or a+1==b or k<=a:
    print(k+1)
else :
    left  = k-a-1
    s+=b
    s+= (left//2)*(b-a)
    if left%2 :s+=1
    print(s)

Solution (Python):
k, a, b = list(map(int, input().split(" ")))

if(a >= b):
    print(k+1)
    exit()


if(k+1 >= k+1+(-2-a+b)):
    print(k+1)
    exit()


if((k+1-a) % 2 == 0):
    print((b-a) * ((k+1-a)//2) + a)
else:
    print((b-a) * ((k+1-a)//2) + a + 1)

Solution (Python):
k,a,b=map(int,input().split())
if b-a <= 2:
    print(k+1)
elif k < a+1:
    print(k+1)
else:
    k-=(a+2-1)
    q,mod=divmod(k,2)
    print(mod+q*(b-a)+b)

Solution (Python):
def main():
    k, a, b = map(int, raw_input().split())
    biscuit = 1
    mon = 0
    if b - a <= 2:
        print 1 + k
        return
    if biscuit < a:
        if k < a - biscuit:
            print 1 + k
            return
        k -= a - biscuit
        biscuit = a
    print biscuit + (b - a) * (k / 2) + k % 2


if __name__ == '__main__':
    main()

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**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


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():
    K, A, B = LI()
    result = 0
    
    if A >= B - 1:
        
        result = K + 1
        print(result)
        return

    
    
    times_to_first_yen = A - 1
    
    remaining_times = K - times_to_first_yen
    result += (remaining_times // 2) * (B - A) + A
    
    if remaining_times % 2 != 0:
        result += 1

    print(result)


main()

Solution (Python):
k,a,b=map(int,input().split())
c=b-a
ans=0
if a+2>=b or a>=k:
        ans=1+k
else:
        ans=a+((k-a+1)//2)*c+(k-a+1)%2
print(ans)

Solution (Python):


import sys

i_str = input().split(' ')
k = int(i_str[0])
a = int(i_str[1])
b = int(i_str[2])



if b <= a + 2:
    print(1 + k)
else:
    bis = 1
    if bis < a:
        k -= (a - 1)
        bis += (a - 1)
    
    bis = bis + (- a + b) * (k // 2)
    bis += k % 2
    print(bis)

Solution (Python):
K,A,B=map(int,input().split())

if B<=A+2 or K<=A :
    print(K+1)
else:
    if (K-(A-1))%2==0:
        print(A+(B-A)*((K-(A-1))//2))
    else:
        print(A+(B-A)*((K-(A-1))//2)+1)

Solution (Python):
k, a, b = map(int, input().split())
p = a-1
q, r = divmod(k-p, 2)

print(max(k+1, q*(b-a)+a+r))

Solution (Python):


K, A, B = map(int, input().split())

if K == 1:
    print(2)
elif B - A < 3:
    
    print(1+K)
else:
    
    

    
    d = K - A + 1
    if d % 2 == 0:
        res = A + (d//2)*(B-A)
    else:
        res = A+1 + (d//2)*(B-A)

    print(res)

Solution (Python):
def func(K , A , B) : 
    if B >= A + 3 :
        if (K - A + 1) % 2 == 0 : 
            n = int((K - A + 1) / 2)
            return n * (B - A) + A 
        else : 
            n = int((K - A) / 2)
            return n*(B - A) + A + 1
    else : 
        return K + 1


s = input().split(" ")
print( int(func( int(s[0]) , int(s[1]) , int(s[2]) )) )

Solution (Python):
K, A, B = map(int, input().split())
ans = 0

if B <= A + 2:
    ans = K + 1
else:
    ans = ((K - (A - 1)) // 2) * (B - A) + ((K - (A - 1)) % 2 + A - 1) + 1

print(ans)

Solution (Python):
k, a, b = map(int, input().split())
if (a + 2 >= b):
  print(k + 1)
else:
  bisc = a
  k -= a - 1
  bisc += (b - a) * (k // 2)
  if (k % 2):
    bisc += 1
  print(bisc)

Solution (Python):
K, A, B = map(int, input().split())
ans = 1
if B - A <= 1:
    print(K+1)
elif K < A + 1:
    print(K+1)
else:
    K -= A+1
    ans = B
    ans += (B - A) * (K // 2)
    ans += K % 2
    print(ans)

Solution (Python):
K, A, B = map(int,input().split())
if A + 2 >= B:
    ans = K + 1
elif K <= A:
    ans = K + 1
else:
    
    time = K - (A-1)
    ans = A 
    
    n = time // 2
    mod = time % 2
    ans += n*(-A + B)
    ans += mod

print(ans)

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  K, A, B = map(int, input().split())

  if B < (A+2):
    ans = K + 1
  else:
    rest = K - (A - 1)
    n = rest // 2
    ans = A + n * (B - A) + rest % 2
  print(ans)


if __name__ == '__main__':
  main()

Solution (Python):
K, A, B = (int(i) for i in input().split()) 







if (K-A+1) % 2 == 0:
   b = A + (B - A) * ((K - A + 1) // 2)
else:
   b = A + (B - A) * ((K - A + 1) // 2) + 1

if b < K + 1:
    b = K + 1
print(b)

Solution (Python):
def main():
  K, A, B = map(int, input().split())

  if ((B-A) <= 2):
    print(str(K+1))
    return
  
  if (K < (A - 1 + 2)):
    print(str(K+1))
    return
  
  r = K - (A - 1)
  a = r // 2
  b = r % 2

  print(a*(B-A) + A + b)

main()

Solution (Python):
K, A, B = map(int, input().split())
if A - B >= -2:
    print(1 + K)
    exit()
n = A
K = K - A + 1
if K % 2 == 0:
    n += int(K / 2) * (B - A)
else:
    n += int(K / 2) * (B - A) + 1
print(n)

Solution (Python):


k, a, b = map(int, input().split())
n=1

if ((b-a)<=2)|(k<=a):
    print(k+1)
else:
    s=k-a+1
    print(int(s/2)*(b-a)+a+(s%2))

Solution (Python):
K, A, B = map(int,input().split())
if B - A <=2:
    print(1 + K)
    exit()
if K < A:
    print(1 + K)
    exit()
bis_num = A
K = K - A + 1
if K % 2 == 1:
    K  = K - 1
    bis_num += 1
x = K // 2
_bis_num = x * (B - A)
bis_num += _bis_num
print(bis_num)

Solution (Python):
k,a,b=map(int,input().split())
q=(k-a+1)//2
if a>=b or a+1==b or a+2==b:
  print(k+1)
else:
  if k>=a+1:
    if (k-a+1)%2==1:
      print(b+(q-1)*(b-a)+1)
    else:
      print(b+(q-1)*(b-a))
  else:
    print(k+1)

Solution (Python):
def m():
    K, A, B = map(int, input().split())
    ans = 0
    if B - A <= 2:
        return K+1
    if K <= A:
        return K+1
    cnt = K-A+1

    amari = 0
    if cnt % 2 == 1:
        amari = 1
    ans += (cnt//2) * B - ((cnt//2)-1)*A
    ans += amari
    return ans

print(m())

Solution (Python):

K, A , B = map(int,input().split())
n = 1
if  A >= B:
    print (K+n)
elif K <=  A:
    print (K+n)
else:
    K -= (A-1)
    n += (A-1)
    if (B-A) > 2:
        n += int(K/2)*(B-A) + K % 2
    else:
        n += K
    print (n)

Solution (Python):
k, a, b = map(int, input().split())
ans = 1
cnt = 0

if  (b - a) / 2 > 1:
    ans += max(a - 1, 0)
    cnt += max(a - 1, 0)
    
    
    x = (k - max(a - 1, 0)) // 2
    ans += (b - a) * x
    cnt += 2 * x
    
    
    ans += k - cnt
    
    
else:
    ans = 1 + k
    
print(ans)

Solution (Python):
k, a, b = list(map(int, input().split()))

if a+2 >= b or k <= a:
    print(k+1)
else:
    n = k - (a + 1)
    if n % 2 ==0:
        m = n // 2
        print((m+1) * b - m * a)
    else:
        m = (n-1) // 2
        print((m + 1) * b - m * a + 1)

Solution (Python):
K, A, B = list(map(int, input().split()))

if A+2 >= B:
    print(K+1)
else:
    K -= A-1

    count = (B-A) * (K//2) + (K % 2) + A

    print(count)

Solution (Python):
import sys
import numpy as np

input = sys.stdin.readline
k, a, b = map(int, input().split())
ans = 0
if b - a > 2:
    if k >= a+1:
        ans += b
        k -= a+1
        ans += int(k/2) * (b - a) + int(k%2)
    else:
        ans += k+1
else:
    ans += k+1
        
print(ans)

Solution (Python):
K, A, B = map(int, input().split())

if A + 1 >= B:
    ans = K + 1
else:
    rem = K - (A - 1)
    double = rem // 2
    remrem = rem - double * 2
    ans = B + (double - 1) * (B - A) + remrem
print(ans)

Solution (Python):
K, A, B = map(int, input().split())

if A + 2 < B:
    if A - 1 >= K:
        print(K + 1)
    else:
        if (K - A + 1) % 2 == 0:
            print((K - A + 1)//2*(B-A) + A)
        else:
            print((K - A + 1)//2*(B-A) + A + 1)
else:
    print(K + 1)

Solution (Python):
K,A,B = (int(i) for i in input().split())
if A+2>=B:
    print(1+K)
else:
    Bis = A
    K-=A-1
    Bis += int(K/2)*(B-A)
    if(K)%2==1:
        Bis+=1
    print(Bis)

Solution (Python):
K, A, B = map(int,input().split())
if B-A <=2:
    ans = K + 1
elif K <= A:
    ans = K +1
else:
    
    time = K - (A-1)
    ans = A 
    
    n = time // 2
    mod = time % 2
    ans += n*(-A + B)
    ans += mod

print(ans)

Solution (Python):
K, A, B = map(int,input().split(" "))
bis = 1
if A+1 >= B:
    print(int(K)+1)
else:
    bis += A-1
    K -= A-1
    if K%2 == 1:
        bis += 1
        K -= 1
    bis += (B-A) * (K // 2)
    print(bis)

Solution (Python):

def main():
	k, a, b = list(map(int, input().split()))

	n = 1

	if a > k - 1:
		print(n + k)
		return

	n += a - 1
	k -= a - 1

	
	if b - a >= 2 and k >= 2:
		n += (b - a) * (k // 2) + k % 2
	else:
		n += k

	print(n)


if __name__ == '__main__':
	main()

Solution (Python):
k,a,b=map(int,input().split())
bis=1
total=0
mon=0
if a+2>=b or k<=a-1:
    total=k+1
else:
    x=k-a+1
    total+=a
    total+=(x//2)*(b-a)
    if (k-a+1)%2==1:
        total+=1
    
print(total)

Solution (Python):
K, A, B = map(int, input().split())
b = 1
if B - A <= 2 or K - 1 < A:
    print(K + b)
else:
    K -= (A - 1)
    print((K // 2) * (B - A) + (K % 2) + A)

Solution (Python):


import math

K,A,B = [int(x) for x in input().split()]

num = 1
money = 0


if B - A <= 2:
    num += K
else:
    turn = K
    turn -= (A - num)
    num = A
    if turn % 2 == 0:
        add = (B - A) * int((turn / 2))
        num += add
    else:
        num += (B - A) * int(math.floor(turn / 2))
        num += 1
print(int(num))

Solution (Python):
K, A, B = list(map(int, input().split()))

cur = 1

if B - A <= 2:
	print(1 + K)
	exit(0)

if K - (A - 1) < 0:
	print(1 + K)
	exit(0)

res = A + (K - (A - 1)) // 2 * (B - A)
if (K - (A - 1)) % 2 != 0:
	res += 1

print(res)

Solution (Python):
import sys

k,a,b = [int(x) for x in input().split()]

if k < a or (b-a)<=1:
    print(k+1)
    sys.exit()

print(a + (k-a+1)//2 * (b-a) + (k-a-1)%2 )

Solution (Python):
K, A, B = map(int, input().split())
if B - A <= 2 or K <= A:
    print(K + 1)
else:
    K -= A + 1
    if K % 2:
        print(B + (B - A) * ((K - 1) // 2) + 1)
    else:
        print(B + (B - A) * (K // 2))

Solution (Python):
def func(k, a, b):
    if b > a + 2 and k >= a - 1:
            print(a + (b - a) * ((k - a + 1) // 2)
                  + (k - a + 1) % 2)
    else:
        print(1 + k)



k, a, b = [int(i) for i in input().split()]
func(k, a, b)

Solution (Python):
K, A, B = map(int, input().split())
if A >= B-2:
    print(K+1)
else:
    nokoriK = K + 1 - A
    if nokoriK % 2 == 0:
        maisu = A + (B-A) * nokoriK // 2
    else:
        maisu = A + (B-A) * (nokoriK-1) // 2 + 1
    print(maisu)

Solution (Python):
import sys
K, A, B = map(int, input().split())
if B - A <= 2 or K <= A:
    print(1 + K)
    sys.exit()

print(A + (B - A) * ((K - A + 1) // 2) + ((K - A + 1) % 2))

Solution (Python):
import math
k,a,b = map(int,input().split())
bis = 0
if b-a>2 and k>a:
  bis += a + math.floor((k-a+1)/2)*(b-a) + (k-a+1)%2
else:
  bis += k+1
print(int(bis))

Solution (Python):
IN=lambda:list(map(int,input().split()))
k,a,b=IN()

if b-a<=2 or k<a+1:
  print(k+1)
else:
  print(a+((k+1-a)//2)*(b-a)+(k+1-a)%2)

Solution (Python):
K,A,B = [int(x) for x in input().split()]
if(B-A <=2):
    print(K+1)
else:
    Q = (K+1-A)
    n = int(Q/2)
    print(n*(B-A)+A+Q%2)

Solution (Python):


line=input().split()
K=int(line[0])
A=int(line[1])
B=int(line[2])

b_rate=B-A

i=0

if K<=A:
    print(A+1)
    exit(0)

sum=A
K-=A-1

if b_rate>2 and K>=2:
    sum+=K//2*b_rate
    if K%2==1:
        sum+=1
else:
    sum+=K
print(sum)

Solution (Python):
K,A,B=map(int,input().split())
K1=K-(A+1)
n=K1//2
print(max(K+1,((n+1)*B-n*A+K1%2)))

Solution (Python):
k, a, b = list(map(int,input().split()))

if b - 1 <= a:
    print(k + 1)
    exit()
if k <= 2:
    print(k+1)
    exit()

diff = b - a
k -= a + 1
n = k // 2
rest = k % 2
if n == 0:
    print(b + rest)
    exit()
print(b + n * diff + rest)

Solution (Python):

k, a, b  = map(int, input().split() )



if b-a <= 2:
    print(k+1)

else: 
    tap = a-1

    remK = k-tap


    ans = a
    ans += (remK // 2) *( b-a ) + remK % 2
    print(ans)

Solution (Python):
K,A,B = map(int,input().split())
x = (K-(A-1))//2
if (K-(A-1))%2==1:
    ans = (x*B-(x-1)*A+1)
else:
    ans = (x*B-(x-1)*A)
print(max(ans,K+1))

Solution (Python):

import sys
import functools

K, a, b = list(map(int, input().split()))

if a >= b:
    print(K + 1)
else:
    if K >= a + 1:
        k = K - (a - 1)

        
        if b - a > 2:
            
            print((k // 2) * b - (k // 2 - 1) * a + (k % 2))            
        else:
            
            print(K + 1)
    else:
        print(K + 1)

Solution (Python):
k,a,b = map(int, input().split())

if(b<=a+2):
  print(1+k)
else:
  ans=a+(k-(a-1))//2*(b-a)+(k-(a-1))%2
  print(ans)

Solution (Python):
k, a, b = map(int, input().split(' '))

ans = 1
if b - a <= 2:
    
    ans += k
elif k < (a - 1) + 2:
    
    ans += k
else:
    k -= (a - 1) + 2
    ans = b
    ans += (b - a) * int(k / 2)
    if k % 2 == 1:
        ans += 1

print(ans)

Solution (Python):
K, A, B = map(int, input().split())

ans = 1
if (B - A) > 2:
    ans = A
    if (K - (A - 1)) % 2 == 0:
        ans += (B - A) * int((K - (A - 1)) / 2)
    else:
        ans += (B - A) * int((K - (A - 1)-1) / 2) + 1
else:
    ans += K
print(ans)

Solution (Python):
K,A,B = map(int, input().split(" "))

if A + 2 >= B:
  print(K + 1)
else:
  firstHit = A - 1
  remainingK = K - firstHit
  if remainingK % 2 == 0:
    print(A + (B - A) * (remainingK // 2))
  else:
    print(A + (B - A) * (remainingK // 2) + 1)

Solution (Python):
K,A,B = [int(i) for i in input().split()]
if A >= B - 1:
    print(K+1)
else:
    ans = 0
    count = (K+1-A)//2
    amari = (K+1-A)%2
    ans += count*(B-A)
    ans += amari
    ans += A
    print(ans)

Solution (Python):
import math

k,a,b=map(int,input().split())


if(b>a+2):

	rem = k-a+1
	if(rem%2==0):
		n=(b-a)*rem//2+a
	else:
		n=(b-a)*(rem//2)+a+1
	print(n)
	
else:
	print(1+k)

Solution (Python):
K, A, B = map(int, input().split())

if B - A < 2 or K < A + 1:
    print(K + 1)

else:
    x = K - A - 1
    num = B + (x // 2) *(B - A) + (x % 2)
    print(num)

Solution (Python):
k,a,b = map(int,input().split())
if a>=b-2:
    print(1+k)
elif a==1 and k>=2:
    print(1+(b-a)*(k//2)+(k%2))
elif k<a+1:
    print(1+k)
else:
    alpha = k-(a+1)
    print(b+(b-a)*(alpha//2)+(alpha%2))

Solution (Python):
k, a, b = map(int,input().split())

if a >= b:
    print(1+k)
else:
    p1 = [1,1]
    p2 = [b-a,2]
    proc = [p1,p2]
    proc.sort(key=lambda x:x[0]/x[1])
    proc.reverse()
    if proc[0] == p1:
        print(1+k)
    elif proc[0] == p2:
        if a-1 > k:
            print(1+k)
        else:
            print(a+((k-a+1)//2)*(b-a)+(k-a+1)%2)

Solution (Python):
k,a,b = map(int,input().split())

if a>=b-2 or a >= k:
  print(k+1)


else: 
  tataku = (a-1)
  nokori = k-(a-1)
  koukan_times = nokori//2

  bisuket = a + (b-a)*koukan_times

  if nokori%2 == 1:
    print(bisuket+1)
  else:
    print(bisuket)

Solution (Python):

K, A, B = [int(_) for _ in input().split()]

def main():
    if B - A <= 2:
        print(K + 1)
        return

    if K < A + 1:
        print(K + 1)
        return

    ans = B
    k = K - (A + 1)

    ans += (k // 2) * (B - A) + (k % 2)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
i = input().split()
K = int(i[0])
A = int(i[1])
B = int(i[2])

if B - A <= 1:
  print(1+K)
else:
  remainK = K - (A - 1)
  current = A

  if remainK % 2 == 1:
    remainK -= 1
    current += 1

  t = int(remainK / 2) * int(B-A)
  print(int(current + t))

Solution (Python):
k, a, b = map(int, input().split())

if b - a <= 2:
    print(k + 1)
    exit()

ans = a
k -= a - 1

ans += k % 2

ans += (b - a) * (k // 2)

print(ans)

Solution (Python):
K, A, B = map(int, input().split())

if K - 2 < A-1 or B - A <= 2 :
    print(K+1)
    exit(0)

ans = 1
ans += A-1
K -= A-1
if K & 1 == 1:
    ans += 1
    K -= 1

ans += (B-A)*(K//2)
print(ans)

Solution (Python):

"""
Created on Sat Feb  9 20:33:17 2019

@author: Yamazaki Kenichi
"""

K,A,B = map(int,input().split())

if B-A <= 2:
    print(1+K)
else:
    ans = 0
    c = (K+1) - A
    if c%2 ==0:
        ans += (c//2)*(B-A)
    else:
        ans += (c//2)*(B-A)+1
    ans += A
    print(ans)

Solution (Python):
k, a, b = map(int, input().split())
if b <= a + 2 or k <= a - 1:
    print(k+1)
    exit()
time = k - a + 1
diff = b - a
print(a + (time//2)*diff+(time % 2))

Solution (Python):
k,a,b=map(int,input().split())
kk=k



k-=a-1
ko=k//2

print(max(ko*(b-a)+a+k%2,kk+1))

Solution (Python):
K, A, B = map(int, input().split())

if B <= A + 2:
    print(K+1)
    exit()

if K <= A:
    print(K+1)
    exit()

x = (K-(A+1)) // 2
y = (K-(A+1)) % 2
print(B + x * (B-A) + y)

Solution (Python):
K, A, B = map(int, input().split())

if B - A >= 2:
    if K >= A:
        ans = ((K - A + 1) // 2) * (B - A) + A + ((K - A - 1) % 2)
    else:
        ans = 1 + K
else:
    ans = 1 + K

print(ans)

Solution (Python):
k, a, b = map(int, input().split())
k2 = k - (a - 1)
cookie = a
cookie += (b-a)*(k2//2)
if k2 % 2 == 1:
    cookie += 1
print(max(cookie, k+1))

Solution (Python):
k,a,b=map(int,input().split())
def abc(k,a,b,n):
    if a-n+2>k or k<2:
        print(n+k)
    elif n>=a:
        print(n+(b-a)*int(k//2)+k%2)
    else:
        abc(k-a+n-2,a,b,b)

if b-a<=2:
    print(k+1)
else:
    abc(k,a,b,1)

Solution (Python):
K, A, B = map(int, input().rstrip().split())

if B - A <= 2 or K <= A:
    print(K + 1)
else:
    print(A + (B - A) * int((K - A + 1) / 2) + (K - A + 1) % 2)

Solution (Python):
S = list(map(int,input().split()))
K = S[0]
A = S[1]
B = S[2]
if B - A <= 2:
    answer = 1 + K
else:
    if K+1 < A+2:
        answer = 1 + K
    else:
        n = (K+1-(A+2))//2 + 1
        answer = n*B - (n-1)*A + (K+1-(A+2))%2
print(answer)

Solution (Python):
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

k, a, b = mi()
ans1 = k + 1
ans2 = 0
if b > a and k > a - 1:
    k -= a - 1
    ans2 = a + (k // 2) * (b - a) + k % 2
print(max(ans1, ans2))

Solution (Python):
K, A, B = map(int, input().split())

if (B-A > 2):
    if (K < A+1):
        print(1+K)
    else:
        K = K - (A+1)
        bis = B
        kaisuu = int((K - K%2)/2)
        amari = int(K%2)
        bis += kaisuu * (B-A) + amari
        print(bis)
else:
    print(1+K)

Solution (Python):
k, a, b = [int(i) for i in input().split()]

if a+2 >= b:
    print(k+1)
elif k == a+1:
    print(b)
elif k < a+1:
    print(k+1)
else:
    if (k-a) % 2 == 0:
        print((k-a) // 2 * (b-a) + a + 1)
    else:
        print((k-a) // 2 * (b-a) + b)

Solution (Python):
K, A, B = map(int, input().split())
now = 1

if A <= B - 3:
   if A - now + 2 <= K:

        K -= (A - now + 2)
        now = B

        if K % 2 == 0:
            now += (K//2) * B - (K//2) * A
        else:
            now += ((K-1) // 2) * B + 1 -(K//2) * A

   else:
       now += K
       


else:
    now += K

    

print(now)

Solution (Python):
K, A, B = map(int, input().split())

if (B - A <= 2) or (K <= (A-1)):
    print(K+1)
else:
    if (K-A+1)%2 == 0:
        print((K-A+1)//2 * (B-A) + A)
    else:
        print((K-A+1)//2 * (B-A) + A+1)

Solution (Python):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor

import heapq
import itertools
import operator


def get_int():
    return int(input())


def get_str():
    return input().strip()


def get_int_list():
    return [int(i) for i in input().split()]


def get_char_list():
    return list(input().strip())


def main():
    k, a, b = get_int_list()
    if b - a < 2:
        print(1 + k)
        return
    print(a + ((k - (a - 1)) // 2) * (b - a) + ((k - (a - 1)) % 2))


if __name__ == '__main__':
    main()

Solution (Python):
K,A,B = map(int,input().split(' '))

ans = 0
if B <= A + 2:
	ans = 1+K
else:
	if K <= A:
		ans = 1 + K
	else:
		K -= A-1
		if K % 2 == 1:
			ans += 1
			K -= 1
		N = K//2
		ans += A+(B-A)*N

print(ans)

Solution (Python):
(K,A,B) = map(int,input().split())

if B <= A+2 or K <= A:
  print(K+1)
else:
  n = K - A + 1
  print(A+(n//2)*(B-A)+(n%2))

Solution (Python):
import math
import sys
from operator import itemgetter









k, a, b = map(int, input().split())

ans = 1

ans += a - 1
k = k - ans + 1


if (b - a >= 2):
	if (k % 2 == 1):
		ans += (k//2) * (b - a) + 1
	else:
		ans += (k//2) * (b - a)
else:
	ans += k

print(ans)

Solution (Python):
K, A, B =map(int,input().split())
import sys
should_actAB = (B-A)
if should_actAB<=2:
    print(K+1)
    sys.exit()
 
else:
    ans_cookie=1
    K_=K-(A-1)
    ans_cookie+=(A-1)
    if K_%2==0:
        ans_cookie+=should_actAB*(K_)//2
    else:
        ans_cookie+=should_actAB*(K_-1)//2+1
print(ans_cookie)

Solution (Python):
K, A, B = map(int, input().split())
if K < A:
    print(K + 1)
else:
    if A + 1 < B:
        P = K - A + 1
        print((P // 2) * (B - A) + int(P % 2 != 0) + A)
    else:
        print(K + 1)

Solution (Python):
def solve(K, A, B):
    if B - A <= 2:
        return K + 1
    elif K <= A:
        return K + 1
    else:
        K -= (A - 1)
        if K <= 2:
            return (K // 2) * B
        else:
            if K % 2 == 0:
                return B + (K // 2 - 1) * (B - A)
            else:
                return B + (K // 2 - 1) * (B - A) + 1


if __name__ == "__main__":
    K, A, B = tuple(map(int, input().split(" ")))
    print(solve(K, A, B))

Solution (Python):
k,a,b=map(int,input().split())
import sys
if k<=a:
    print(k+1)
    sys.exit()
ans=a
k-=a-1
if k%2==1:
    k-=1
    ans+=1

if b-a>=2:
    ans+=(b-a)*(k//2)
else:
    ans+=k

print(ans)

Solution (Python):
K, A, B = list(map(int, input().split(" ")))

def main():
    if B - A <= 2 or A - 1 >= K:
        return 1 + K
    
    tmp = K - A + 1
    if tmp % 2 == 0:
        out = A + tmp // 2 * (B-A)
    else:
        out = A + (tmp-1) // 2 *(B-A) + 1
    return out

out = main()
print(out)

Solution (Python):
k, a, b = map(int, input().split(' '))

delta_per_act_hit = 1
delta_per_act_exchange = (b - a) / 2

if delta_per_act_hit >= delta_per_act_exchange:
    print(1+k)
    exit(0)

else:
    
    num_exchangeable = (k - (a-1)) // 2

    if num_exchangeable <= 0:
        print(1+k)
        exit(0)
    else:
        print(1 + (b-a) * num_exchangeable + (k - num_exchangeable*2))
        exit(0)

Solution (Python):
k, a, b = map(int, input().split())
add2 = b - a
s = 1
if add2 <= 2:
    s += k
else:
    if k + 1 <= a:
        s += k
    else:
        s = a
        k -= a - 1
        s += add2 * (k // 2)
        s += k % 2
    
print(s)

Solution (Python):
K, A, B = [int(elem) for elem in input().split()]

if B - A <= 2:
    print(K + 1)
else:
    first_num_exchanges = A + 1
    rest_num_exchanges = K - first_num_exchanges
    gain_per_two_manipulation = B - A
    num_cookies = rest_num_exchanges // 2 * gain_per_two_manipulation + B
    if rest_num_exchanges % 2 == 1:
        num_cookies += 1
    print(num_cookies)

Solution (Python):
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
k,a,b=IL()
ans=1
if a>=b:
    ans=1+k
else:
    if b-a<=2:
        ans=1+k
    else:
        if a-1+2>k:
            ans=1+k
        else:
            k=k-(a+1)
            ans=b
            ans+=(k//2)*(b-a)+k%2
print(ans)

Solution (Python):
K,A,B=map(int,input().split())
print(A+((K-A+1)//2)*(B-A)+(K-A+1)%2) if(B-A>2 and K-A>0) else print(K+1)

Solution (Python):
K,A,B = map(int,input().split())
if B<=A+2:
    print(K+1)
else:
    if (K-A+1)%2==0:
        print(A+(B-A)*((K-A+1)//2))
    else:
        print(A+(B-A)*((K-A)//2)+1)

Solution (Python):
K, A, B = map(int, input().split())
p = 1
if A + 2 >= B:
    print(1+K)
else:
    K = K - (A-1)
    p = A
    m = K // 2
    n = K % 2
    p += m * (B-A) + n
    print(p)

Solution (Python):
K,A,B = map(int,input().split())

if B-A > 1 and K>A:
    count = A
    K -= A-1
    count += (K//2)*(B-A)
    K -= (K//2)*2
    count += K
else:
    count = K+1

print(count)

Solution (Python):
K,A,B=map(int,input().split())

if A+2 >= B or K <= A:
  print(K+1)
else:
  cnt=K-(A-1)
  ans=A
  if cnt%2==0:
    ans+=((cnt//2)*(B-A))
    print(ans)
  else:
    ans+=((cnt//2)*(B-A))
    ans+=1
    print(ans)

Solution (Python):
k,a,b=map(int,input().split())
if a>=b-2 or k<a+1:
    print(k+1)
    exit()
n=a
k-=(a-1)
z=k//2
n+=(z*(b-a))
if k%2==1:
    n+=1
print(n)

Solution (Python):
k, a, b = map(int, input().split())
if b <= a + 2:
    print(k + 1)
elif k <= a - 1:
    print(k + 1)
else:
    ans = 0
    nokori = k

    ans += (a - 1)
    nokori -= (a - 1)

    ans += (b - a) * ((k - (a - 1)) // 2)
    nokori -= 2 * ((k - (a - 1)) // 2)


    ans += nokori


    print(ans+1)

Solution (Python):
K, A, B = map(int, input().split())
ans = 0
if A + 1 >= B or K + 1 <= A :
    ans = K + 1
else:
    ans = ans + B
    ans = ans + (K - A - 1) // 2 * (B - A)
    ans = ans + (K - A - 1) % 2

print(ans)

Solution (Python):
K,A,B=map(int,input().split())

if A+1<B:
    if K<A+1:
        print(1+K)
    else:
        M=A
        M=M+((K-(A-1))//2)*(B-A)
        if (K-(A-1))%2==1:
            M+=1
        print(M)
else:
    print(1+K)

Solution (Python):
K,A,B=map(int,input().split())
if(B-A<=2):
    print(K+1)
elif(A>=K):
    print(K+1)
else:
    count=K-A+1
    yaru=int(count/2)
    if(count%2):
        print(A+yaru*(B-A)+1)
    else:
        print(A+yaru*(B-A))

Solution (Python):
k,a,b = map(int, input().split())

if b -a <= 2:
    print(k+1)
else:
    if (k - a + 1)%2 == 0:
        print(((k - a + 1)//2)*(b -a) + a )
    else:
        print(((k - a)//2)*(b -a) + a + 1 )

Solution (Python):
K, A, B = map(int, input().split())
if K <= A or B - A <= 2:
  print(K+1)
else:
  x = (K-A+1)//2
  r = A+(B-A)*x
  if (K-A+1)%2 == 1:
    r = r+1
  print(r)

Solution (Python):
K, A, B = map(int, input().split())

cnt = A + 2
max_num = max(cnt, B)

tmp = K - A + 1
ans1 = K + 1
if tmp % 2 == 0:
    print(max(ans1, A + tmp // 2 * (B - A)))
else:
    print(max(ans1, A + tmp // 2 * (B - A) + 1))

Solution (Python):
K, A, B = [int(v) for v in input().split()]

if A + 2 >= B:
    print(K + 1)
elif K - 1 < A:
    print(K + 1)
else:
    ans = 1
    remained_op = K
    ans += A - 1
    remained_op -= A - 1
    if remained_op % 2 == 1:
        ans += 1
        remained_op -= 1
    ans += (remained_op // 2) * (B - A)
    print(ans)

Solution (Python):
K,A,B = map(int, input().split())
C = B - A
if C > 2 and K > 1:
    K_rem = K - (A - 1)
    if K_rem > 1:
        print(A + C*(K_rem//2) + K_rem % 2)
    else:
        print(1+K)
else:
    print(1+K)

Solution (Python):
k,a,b=[int(i) for i in input().split()]
if b-a<=2:
    print(k+1)
else:
    if k<a:
        x=k+1
    else:
        x=a+(b-a)*((k-a+1)//2)+((k-a+1)%2)
    print(x)

Solution (Python):
K,A,B = map(int,input().split())
if B <= A+1:
    print(K+1)
else:
    K = K - A + 1
    if K%2 == 0:
        print(int(K//2)*(B-A) + A)
    else:
        print(int(K//2)*(B-A) + A + 1)

Solution (Python):
k,a,b = (int(i) for i in input().split())
res = 1
if k >= a-1:
    res += a-1
    k -= a-1
else:
    res += k
    k = 0
if k > 0:
    if b-a > 2:
        res += (b-a) * (k//2)
        if k%2==1:
            res += 1
    else:
        res += k

print(res)

Solution (Python):
k,a,b=map(int,input().split())
if a+2>=b:print(k+1)
elif a>=k:print(k+1)
else:
    k-=(a+1)
    ans=b+(b-a)*(k//2)
    if k%2==1:print(ans+1)
    elif k%2==0:print(ans)

Solution (Python):
K, A, B = map(int, input().split())

if A >= B:
    print(K + 1)
else:
    
    have = 1
    if (A - have) <= K:   
        K -= (A - have)
        have = A
        
        rep = K // 2
        tataku = K % 2
        rep_add = max(B - A, 2)
        have += rep_add * rep
        have += tataku
    else:
        have += K        
    print(have)

Solution (Python):
def a():
    n, k = map(int, input().split())
    if int(n / 2 + 0.5) >= k:
        print("YES")
    else:
        print("NO")


def B():
    root = [[0 for i in range(4)] for j in range(4)]
    for i in range(3):
        a, b = map(int, input().split())
        
        root[a - 1][b - 1] = 1
        root[b - 1][a - 1] = 1

    cnt_one = 0
    cnt_two = 0
    for i in range(4):
        if sum(root[i]) == 1:
            cnt_one += 1
        if sum(root[i]) == 2:
            cnt_two += 1
    if cnt_one == 2 and cnt_two == 2:
        print("YES")
    else:
        print("NO")



def C():
    k, a, b = map(int, input().split())
    if a < b and b - a >= 2:
        cnt = a
        k -= (a - 1)
        cnt += k // 2 * (b - a)
        k -= k // 2 * 2
        cnt += k
        print(cnt)
    else:
        print(k + 1)
C()

Solution (Python):
K, A, B = map(int, input().split())

if A + 2 >= B or K <= A:
    print(K + 1)
else:
    ans = A
    rem_times = K - (A - 1)
    if rem_times % 2 != 0:
        ans += 1
        rem_times -= 1
    ans += (B - A) * (rem_times // 2)
    print(ans)

Solution (Python):
K,A,B=map(int,input().split())
if A+2>=B or 1+K<=A:
  ans=1+K
else:
  M=K-A+1
  s,t=M//2,M%2
  ans=A+s*(B-A)+t
print(ans)

Solution (Python):
K, A, B = map(int, input().split(" "))

if B-A >= 3:
    l = K-(A-1)
    
    print(A+(B-A)*(l//2)+l%2)
else:
    print(K+1)

Solution (Python):
K, A, B = map(int, input().split())

if A>= B:
    print(K + 1)
elif A <= B <= A+2:
    print(K + 1)
else:
    to_A = A - 1
    last_K = K - to_A
    if last_K <= 0:
        print(K)
    else:
        if last_K % 2 == 0:
            print(A + (B-A) * last_K // 2)
        else:
            print(A + (B - A) * (last_K // 2) + 1)

Solution (Python):
K, A, B = map(int, input().split())
if B <= A + 1:
    print(K + 1)
else:
    if A - 1 > K:
        print(K + 1)
    else:
        L = K - A + 1
        count = L // 2
        r = L % 2
        print(count * (B - A) + A + r)