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



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

    if B - A <= 2:  
        return 1 + K

    K += -(A-1)

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

    return (K // 2 - 1) * (B - A) + B + 1


if __name__ == "__main__":
    print(main())

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

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

Solution (Python):
import math

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

if B - A <= 2:
    print(K + 1)
else:
    numn_action = K - A + 1
    print((B - A) * math.floor(numn_action / 2) + numn_action % 2 + A)

Solution (Python):
k,a,b = (int(i) for i in input().split())
yen = 0
bisc = 1
kouritu = b/a

tmp1 = 1+k
tmp2 = 0

if k+1-a >= 0 and a<= b:
 kaisuu = (k-a+1)//2
 sabun =  (k-a-1)%2 
 tmp2 = a + kaisuu*(b-a) +sabun
print(max(tmp1,tmp2))

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

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

Solution (Python):
K, A, B = map(int, input().split())
if A + 2 >= B:  
    print(K + 1)
elif K < A + 1:  
    print(K + 1)
else:
    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:
  print(k+1)
else:
  if k<=a:
    print(k+1)
  else:
    x=k-a-1
    if x%2==0:
      y=x//2
      ans=(y+1)*b-y*a
      print(ans)
    else:
      y=x//2
      ans=(y+1)*b-y*a+1
      print(ans)

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

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

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

ans = B
nokori = K-A-1
rieki = B-A
ans += (nokori//2)*rieki+(nokori%2)
print(ans)

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

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


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

print(ans)

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

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

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


ans = k + 1

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

print(ans)

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

Solution (Python):
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

K,A,B = IL()

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

print(cnt)

Solution (Python):
K, A, B = map(int, raw_input().split())
res = 1
if K >= A:
    res += A - 1
    K -= A - 1

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

print res

Solution (Python):
K,A,B =[int(i)for i in input().split()]
if A+2 >= B or K <= A:
    print(K+1)
else:
    N = K -A+1
    N =N//2
    print(K+1+(B-A-2)*N)

Solution (Python):


s = [int(e) for e in input().split()]
K = s[0]
A = s[1]
B = s[2]

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

Solution (Python):
k,a,b=map(int,input().split())
if b-a<=2:
    print(k+1)
    quit()
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):
K, A, B = map(int, input().split())

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



d = B - A
num = (K - (A-1)) // 2
mod = (K - (A-1)) % 2
print(A + (B-A)*num + mod)

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

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

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

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

Solution (Python):
def main(k, a, b):
    if k < a:
        return k + 1
    
    t = a
    k -= a - 1
    if b - a >= 2:
        t += (b - a) * (k // 2)
        k -= (k // 2) * 2
    
    t += k
    return t


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

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

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

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

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

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

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

move_left = K

bis = 1

if A - bis >= move_left:
    print(1 + K)
    exit(0)

move_left -= A - bis
bis = A



bis += (B - A) * (move_left // 2)
move_left -= 2 * (move_left // 2)




bis += move_left 


















print(bis)

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

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

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


if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()

Solution (Python):
k, a, b = map(int, input().split())
l = int((k - a + 1)/2)

if a >= b - 1:
  print(k + 1)
else:
  print(a + l * (b - a) + k - a + 1 - 2 * l)

Solution (Python):
k,a,b=list(map(int,input().split(" ")))
if k<=a:
    print(k+1)
else:
    d=b-a
    if d<=2:
        print(k+1)
    else:
        l=k-a+1
        m=l&1
        print(a+(l>>1)*d+m)

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

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

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

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

Solution (Python):
import numpy as np

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

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

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

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

elif K <= A:
    print(K + 1)

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

    print(bis)

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

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

if k <= a:
    print(k + 1)
    exit(0)

n = 0
ans = 0
if (k - a + 1) % 2 == 0:
    n = (k - a + 1) // 2
else:
    n = (k - a + 1) // 2

ans = (k - n * 2) + 1


ans += (b - a) * n
print(ans)

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

if b - a <= 1:
    print(k+1)
else:
    ans = 1
    rest = k

    if a > 1:
        ans += a - 1
        rest -= a - 1

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

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

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

Solution (Python):



import sys  
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools



sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+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 DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
def dump(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)


def local_input():
    from pcm.utils import set_stdin
    import sys
    from pathlib import Path
    parentdir = Path(os.path.dirname(__file__)).parent
    inputfile = parentdir.joinpath('test/sample-1.in')
    if len(sys.argv) == 1:
        set_stdin(inputfile)


def solve():
    k,a,b = map(int, input().split())
    res = 0
    if (a+2)<b:
        if (a+2)>(k+1):
            res = k+1
        else:
            r = (k+1)-(a+2)
            dump(r, b-a)
            res = b
            res += (r//2)*(b-a)
            res += r%2
    else:
        res = k+1

    print(res)

    return 0

if __name__ == "__main__":
    try:
        local_input()
    except:
        pass
    solve()

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

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

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

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

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

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

ans = 1

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

if k % 2 == 1:
    ans += 1
    k -= 1

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

print(ans)

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

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

Solution (Python):

import math




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

n = 0
left = k


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

    else:
        left = k - (a-1)    

        n = math.floor(left/2.0)
        print(a + (b - a) * n + (left - 2 * n))

else:
    print(1 + k)

Solution (Python):
from sys import stderr, setrecursionlimit, exit
setrecursionlimit(2147483647)
def getInt():
    return int(input())
def getInts():
    return [int(i) for i in input().split()]
def getIntLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInt())
    return res
def getIntsLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInts())
    return res
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

k,a,b = getInts()


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


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


k -= a - 1
ans = a

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

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

if(a>=b-1):
    print(1+k)
else:
    if(k<=a):
        print(1+k)
    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):
K, A, B = map(int, input().split())
if B - A < 3:
    print(K + 1)
elif K-1 < A:
    print(K + 1)
else:
    K = K - A + 1
    n = K//2
    print(A+ n*(B-A) + K%2)

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

Solution (Python):


import copy
import numpy as np
import random

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

cookie = 1

if b-a < 2:
    cookie += k

else:
    k -= (a-cookie)
    cookie = a

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

    if k % 2 == 1:
        cookie += 1
    else:
        pass

print(cookie)

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

K = K - A + 1
c = A

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

else:
    c += K


print(c)

Solution (Python):




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

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

Solution (Python):


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

diff=c-b

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

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

if (b-a)//2>1:
  c=k-(a-1)
  d,e=divmod(c,2)
  print(a+(b-a)*d+e)
else:
  print(1+k)

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

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

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

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

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

Solution (Python):

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


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


ans = 1

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

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

Solution (Python):
import numpy as np
K,A,B = map(int,input().split())
maximum=0
if (A>=B-1):
    maximum=K+1
elif(K<A+1):
    maximum=K+1
elif((K-A+1)%2==0):
    maximum=A+(B-A)*((K-A+1)//2)
else:
    maximum=A+(B-A)*((K-A)//2)+1
print(maximum)

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

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

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

  print(str(num))

Solution (Python):






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

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

Solution (Python):
k,a,b = map(int, input().split())
if b - a <= 2:
  print(k + 1)
else:
  yen = 0
  if k >= a + 1:
    yen += 1
    k -= a + 1
    c,d = divmod(k,2)
    yen += c
    print(a + (b-a) * yen + d)
  else:
    print(k + 1)

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

Solution (Python):
def main():
    k, a, b = map(int, input().split())
    inc = b - a
    if (inc < 3):
        print(k + 1)
        return

    if (k < a - 1):
        print(k + 1)
        return

    k -= a - 1
    ans = a
    ans += k % 2
    ex = k // 2
    ans += ex * inc
    print(ans)

main()

Solution (Python):
k, a, b = map(int, raw_input().split())
res = k+1
if a >= b:
    print(res)
    exit()

k -= a-1
if k >= 0:res = max(res, a + (k / 2) * (b-a))
k -= 1
if k >= 0:res = max(res, a + 1 + (k / 2) * (b-a))
print res

Solution (Python):

def solve(k,a,b):
    if a >= b:
        return 1+k
    if k <= a-1:
        return 1+k
    diff = b-a
    if diff <= 2:
        return 1+k

    k -= a-1
    ans = a

    r = int(k / 2)
    ans += diff * r;
    if k % 2:
        ans += 1
    return ans

k,a,b=map(int, raw_input().split(' '))
print solve(k,a,b)

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


if b - a <= 2:
    ans = k + 1
else:
    n = 1
    if n > a:
        pass
    else:
        k -= a - n
        n = a

    if k % 2 == 0:
        pass
    else:
        n += 1
        k -= 1

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

print(ans)

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


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


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(K, A, B):
    if A >= B:
        return K + 1
    
    if K <= A - 1:
        return K + 1
    
    if B - A <= 2:
        return K + 1

    
    
    K -= A - 1
    ans = A
    ans += int(math.floor(K / 2)) * (B-A)
    ans += K % 2

    return ans


def main():
    
    K, A, B = read_int_n()
    
    print(slv(K, A, B))


if __name__ == '__main__':
    main()

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

Solution (Python):

from collections import defaultdict
from itertools import permutations
def inpl(): return list(map(int, input().split()))

K, A, B = inpl()
if B <= A + 2 or K <= A:
    print(K+1)
else:
    T = K - A + 1
    d, m = divmod(T, 2)
    print(A + (B-A)*d + m)

Solution (Python):
def solve(K, A, B):
    if A > B:
        return K + 1

    if K < A:
        return K + 1

    ret = K + 1

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

    return max(ans, ret)

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

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

Solution (Python):

from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007


"""
n,k = LI()
if 2*(k-1) < n:
    print("YES")
else:
    print("NO")
"""


"""
c = LIR(3)
v = [[] for i in range(4)]
for i in range(3):
    c[i][0] -= 1
    c[i][1] -= 1
    v[c[i][0]].append(c[i][1])
    v[c[i][1]].append(c[i][0])

for i in range(4):
    li = [True for i in range(4)]
    li[i] = False
    q = [i]
    c = 0
    while q:
        x = q.pop(-1)
        k = 0
        for j in v[x]:
            if li[j]:
                li[j] = False
                q.append(j)
                if k == 0:
                    c += 1
                    k += 1
    if c == 3:
        print("YES")
        quit()
print("NO")
"""


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

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

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

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

    print(counter)

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

Solution (Python):





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

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

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

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

kouho = [k+1]
k = k - (a-1)
r = a
if a+2 <= b:
    r += (k//2)*(b-a)+k%2
kouho.append(r)
print(max(kouho))

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

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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

bis = 1
if A - 1 <= K:
    K -= (A - 1)
    bis += A - 1

if B - A > 2:
    print(bis + (K // 2) * (B - A) + (K % 2))
else:
    print(bis + K)

Solution (Python):

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

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

print(ans)

Solution (Python):

from collections import Counter


def main():
    K, A, B = [int(a) for a in input().split()]
    if B <= A + 2:
        print(K + 1)
        return
    
    if A - 1 >= K:
        print(K + 1)
        return
    k2 = K - A + 1
    k3 = (k2 // 2) * (B - A)
    k4 = k2 % 2
    res = k3 + k4 + A
    print(res)


if __name__ == '__main__':
    main()

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

if A>=B:
    print(K+1)
else:
    if A-1>=K:
        print(K+1)
    elif 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())
if A >= B:
	print(1 + K)
else:
	if A-1 >= K or B-A == 1: print(1 + K)
	else:
		rem = K - A + 1
		increase = rem // 2
		crush = rem % 2
		print(A + (B-A)*increase + crush)

Solution (Python):
K, A, B = list(map(int, input().split()))
if B < A + 2:
    print(1 + K)
else:
    x = 1
    k = K
    if k >= A - 1:
        k -= A - 1
        x += A - 1
    z = k // 2
    k -= z * 2
    x += (B - A) * z
    if k == 1:
        x += 1
    print(x)

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

if A+2 >= B:
    print(K+1)
elif A+1 > K:
    print(K+1)
else:
    P = K - A + 1
    change = P // 2
    amari = P % 2
    
    print(A+amari+change*(B-A))

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

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

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

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

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

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

b = A
b += (K//2) * (B-A)
b += K%2
print(max(ans, b))

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

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

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

K -= A - 1
M = A

if K % 2 == 1:
  K -= 1
  M += 1

M += (B - A) * (K // 2)

print(M)

Solution (Python):


def solve():
    K, A, B = map(int, input().split())
    Ki = K
    
    
    ans = 1
    if ans < A:
        if K < (A-ans):
            print(1+K)
            return
        K -= (A-ans)
        ans = A

    
    print(max(ans+(K//2)*(B-A)+K%2, 1+Ki))

if __name__ == "__main__":
    solve()

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

Solution (Python):




def main():
    k, a, b = list(map(int, input().split()))
    if b - a <= 2 or k - a < 1:
        print(k+1)
        return
    n = (k - a + 1) // 2
    print(1 + k - 2*n + (b - a) * (n))


if __name__ == '__main__':
    main()

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

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

else:
    print(K + 1)

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

N = 1

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

print(N)

Solution (Python):

def main():
    buf = input()
    buflist = buf.split()
    K = int(buflist[0])
    A = int(buflist[1])
    B = int(buflist[2])
    biscuit = 1
    if A >= B - 2:
        biscuit += K
    else:
        if K <= A - 1:
            biscuit += K
        else:
            biscuit += A - 1
            remaining = K - (A - 1)
            buysell_count = remaining // 2
            biscuit += (B - A) * buysell_count
            remaining -= buysell_count * 2
            if remaining == 1:
                biscuit += 1
    print(biscuit)

if __name__ == '__main__':
    main()

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

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

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

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

if last%2:
    last-=1
    b+=1

b += last//2 * (B-A)
print(b)

Solution (Python):
import sys
K,A,B=[int(i) for i in input().split(" ")]


if A>=K+1:
    print(K+1)


elif B>A+2:
    K-=(A-1)
    biscuit=A
    biscuit+=(B-A)*(int(K/2))
    if K%2==1:
        biscuit+=1
    print(biscuit)

else:
    print(K+1)

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

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

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

    else:
        x=K-(A-1)

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

        print(max(ANS,1+K))

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

X=1

Y=0
if A-1>K:
    print(K+1)
    exit()
X=A
Y=A-1
if B-A<=1:
    print(K+1)
    exit()
X+=(B-A)*((K-Y)//2)
Y+=2*((K-Y)//2)
X+=(K-Y)
print(X)

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

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

Solution (Python):
import sys
def inpl(): return list(map(int, input().split()))

K, A, B = inpl()
if A+2 >= B or K-A+1 < 2:
    print(1+K)
    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:
    print(1 + K)
elif K <= A:
    print(1 + K)
else:
    change_num = (K - (A - 1)) // 2
    print(change_num * B - (change_num - 1) * A + (K - (A - 1)) % 2)

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

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

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

Solution (Python):


import sys


INF = float('inf')
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 LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


k, a, b = LI()

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

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

if (k - cnt) % 2:
    ans += 1

print(ans)

Solution (Python):
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    k,a,b = map(int, input().split())
    if a+2>=b:
        print(int(k+1))
        exit()
    print(((k-a+1)//2)*(b-a)+(k-a+1)%2+a)

Solution (Python):
K, A, B = [int(_) for _ in input().split()]
if B - A < 3:
    print(1 + K)
    exit()

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