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):
k, a, b = list(map(int, input().split()))

l = k - (a - 1)
ab = a + (b - a) * (l // 2) + (l % 2) 

print(max(1+k, ab))

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys,bisect,string,math,time,functools,random
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[];g=[[] for i in range(n)]
    for i in range(E):
        inp=LI();org_inp.append(inp)
        if index==0:inp[0]-=1;inp[1]-=1
        if len(inp)==2:
            a,b=inp;g[a].append(b)
            if not Directed:g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp;aa=(inp[0],inp[2]);bb=(inp[1],inp[2]);g[a].append(bb)
            if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,boundary=1,search=[],replacement_of_found='.',mp_def={'

    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):return [[tb//(n**bt)%n for bt in range(k)] for tb in range(n**k)]
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
def show2d(g,h,w):
    for i in range(h):show(g[i*w:i*w+w])

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase

input=lambda: sys.stdin.readline().rstrip()

show_flg=False
show_flg=True




k,a,b=LI()

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

print(ans)

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

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

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

Solution (Python):
import sys


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


sys.setrecursionlimit(10 ** 9)


def main():
    K, A, B = map(int, input().split())
    if (B - A) <= 2:
        answer = 1 + K
    else:
        cookie = A
        cnt = A - 1
        money = (K - cnt) // 2
        hit = (K - cnt) % 2
        cookie += money * (B - A)
        cookie += hit
        answer = cookie
    print(answer)


if __name__ == "__main__":
    main()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

K, A, B = MAP()

if A+1 >= B or A >= K:
	print(1+K)
else:
	ans = A
	K -= A-1
	n, left = divmod(K, 2)
	ans += n*(B-A)+left
	print(ans)

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

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

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

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






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

k -= (a - 1)
ans = a

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

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

    print(ans)


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import sys
import math
input = sys.stdin.readline

k, a, b = map(int, input().split())
if b > a and k + 1 > a:
    ans = max(k + 1, (b - a) * math.floor((k + 1 - a) / 2) + (k + 1 - a) % 2 + a)
else:
    ans = k + 1
print(ans)

Solution (Python):
import sys
input = sys.stdin.buffer.readline

def main():
    K,A,B = map(int,input().split())
    if A+2 >= B:
        print(K+1)
    else:
        if K<=A:
            print(K+1)
        else:
            rest = K-(A-1)
            print(A+(B-A)*(rest//2)+rest%2)
    
if __name__ == "__main__":
    main()

Solution (Python):
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') 
def gcd(a,b):return fractions.gcd(a,b) 
def lcm(a,b):return (a*b) // fractions.gcd(a,b) 
def iin(): return int(sys.stdin.readline()) 
def ifn(): return float(sys.stdin.readline()) 
def isn(): return sys.stdin.readline().split() 
def imn(): return map(int, sys.stdin.readline().split()) 
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) 
def fmn(): return map(float, sys.stdin.readline().split()) 
def iln(): return list(map(int, sys.stdin.readline().split())) 
def iln_s(): return sorted(iln()) 
def iln_r(): return sorted(iln(), reverse=True) 
def fln(): return list(map(float, sys.stdin.readline().split())) 
def join(l, s=''): return s.join(l) 
def perm(l, n): return itertools.permutations(l, n) 
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) 
def comb(l, n): return itertools.combinations(l, n) 
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) 
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

K,A,B = imn()

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

print(max(K+1, ans))

Solution (Python):
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

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

def input_list_str():
  return map(str, input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  k, a, b = input_list()
  ans = 1
  lf = max(0, k - a+1)
  lf1 = lf//2
  if lf:
    ans = a + lf1 * (b - a) + lf%2
  else:
    ans +k
  print(max(ans, k+1))
  
  
import math
import fractions
import collections
from functools import reduce
main()

Solution (Python):

from sys import setrecursionlimit
setrecursionlimit(10**6)
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]

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

tmp = K - (A - 1)
if tmp < 0:
    print(K + 1)
    exit()
cnt = tmp // 2
amari = tmp % 2

ans = cnt * B - (cnt - 1) * A + amari
ans = max(ans, K + 1)
print(ans)

Solution (Python):
K, A, B = map(int, input().split())
if A >= B:
    print(K + 1)
    exit()



tmp = K - (A - 1)
if tmp < 0:
    print(K + 1)
    exit()
cnt = tmp // 2
amari = tmp % 2

ans = cnt * B - (cnt - 1) * A + amari
ans = max(ans, K + 1)
print(ans)

Solution (Python):
import math

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


ans = 1


if K >= A - 1:
    K -= (A - 1)  
    ans += (A - 1) 
else:
    ans += K 
    K = 0 


if A2B > 2:
    times = K // 2  
    ans += A2B * times  
    ans += K % 2  
else: 
    ans += K

print(ans)

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-1)
    biscuits = A

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

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

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

Solution (Python):
def main():
    k, a, b = map(int, input().split())
    cookie = 1
    if b <= a + 1 or 1 + k <= a:
        cookie += k
    else:
        cookie += a - 1
        k -= a - 1
        if k % 2:
            k -= 1
            cookie += 1
        cookie += (b - a) * max(0, k // 2)
    print(cookie)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
step,pay,gain=map(int,input().split())
b=step-pay+1
print(max(step+1,pay+b//2*(gain-pay)+b%2))

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

Solution (Python):









import sys



ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

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

    viscuit = 1

    
    a2b = b - a

    

    if k >= (a-1):
        k -= (a-1)
        viscuit += (a-1)
    else:
        viscuit += k
        k = 0

    if a2b > 2:
        times = k // 2
        rem = k % 2
        viscuit += a2b * times
        viscuit += rem
    else:
        viscuit += k
        k = 0

    print(viscuit)


if __name__ == '__main__':
    main()

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

Solution (Python):
def main():
    k, a, b = map(int, input().split())
    x = k+1
    y = 0
    if b > a:
        c = b-a
        k -= a-1
        y = c*(k//2-1) + b + (k%2)
    print(max(x, y))

if __name__ == "__main__":
    main()

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

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

cnt = a 
k -= a-1


ch = k//2 

cnt += (b-a)*ch 
cnt += k%2
print(cnt)

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys
k, a, b = [int(i) for i in sys.stdin.readline().split()]
if b - a <= 2:
    print(k + 1)
else:
    cnt = 0
    cnt += min(k, a - 1)
    bisk = 1 + cnt + (b - a) * ((k - cnt) // 2)
    bisk += (k - cnt) % 2
    print(bisk)

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

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

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

if B - A <= 2:
    print(1 + K)
elif A + 1 > K:
    print(1 + K)
else:
    rest = K - A + 1
    b = (rest // 2) * (B - A) + rest % 2 + A
    print(max(1 + K, b))

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

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

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

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

Solution (Python):
import copy
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools import product
import sys
stdin = sys.stdin
mod = 10**9 + 7


def ns(): return stdin.readline().rstrip()


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


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

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

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

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

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

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


if __name__ == '__main__':
    main()

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

rem = K-(A-1)
if rem <= 1:
    print(ans)
else:
    ans2 = A
    d,m = divmod(rem,2)
    ans2 += (B-A)*d
    ans2 += m
    print(max(ans, ans2))

Solution (Python):
K,A,B=map(int, input().split())
ans=K+1
if A<B and K>=A:
    n=K-A+1
    ans=max(ans, A+n//2*(B-A)+(n&1))
print(ans)

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

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

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

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

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

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

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

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

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
K, A, B = map(int, input().split())
if A >= B:
  print(K + 1)
  exit(0)
if K <= A:
  print(K + 1)
  exit(0)
print(max(K + 1, ((K - A + 1) // 2) * (B - A) + A * (((K - A + 1) // 2) > 0) + (((K - A + 1) % 2))))

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


if __name__ == '__main__':
    main()

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

Solution (Python):
''' Hey stalker :) '''
INF = 10**10
def main():
    print = out.append
    ''' Cook your dish here! '''
    k, a, b = get_list()
    if 2+a>b or k<a:
        print(k+1)
    else:
        k -= a-1
        bis = a + (k//2)*(b-a) + k%2
        print(bis)



''' Pythonista fLite 1.1 '''
import sys
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right

import math

out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()

print(*out, sep='\n')

Solution (Python):
"""
NTC here
"""
import sys
inp= sys.stdin.readline
input = lambda : inp().strip()
flush= sys.stdout.flush




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




def main():
    k, a, b = lin()
    ans = 1
    lf = max(0, k - a+1)
    lf1 = lf//2
    if lf:
        ans = a+lf1*(b - a) + lf%2
    else:
        ans += k
    print(max(ans, k+1))








        
main()

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

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

Solution (Python):
def examA():
    N, K = LI()
    if (N+1)//2>=K:
        print("YES")
    else:
        print("NO")
    return

def examB():
    d = [0]*4
    for _ in range(3):
        a, b = LI()
        a -=1; b -=1
        d[a] +=1
        d[b] +=1
    for i in d:
        if i>=3 or i==0:
            print("NO")
            return
    print("YES")
    return

def examC():
    K, A, B = LI()
    if A+1>=B:
        ans = K+1
        print(ans)
        return
    l = 0; r = K+1
    while(r-l>1):
        
        now = (l+r)//2
        cur = K - now +1
        if cur<A:
            r = now
        else:
            l = now
    ans = K - l + (l//2)*(B-A) +1 + l%2
    print(ans)
    return
def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LFI(): return list(map(float,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examC()

"""

"""

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

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

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

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

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

Solution (Python):


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

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

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

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

k-=a-1
sm=a
num=int(k/2)
sm += num*(b-a)

if k%2==1:
    sm+=1

print(sm)

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

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

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

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

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

print(ans)

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

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

Solution (Python):


k, a, b = map(int, input().split())
if a >= b or b - a <= 2:
    
    print(1 + k)
    exit()
x = a  
d = k - x  

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

Solution (Python):


k, a, b = map(int, input().split())
if a >= b or b - a <= 2:
    
    print(1 + k)
    exit()
x = a  
d = k - x  

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

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

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

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

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

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

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

Solution (Python):
def main():
    K,A,B = map(int,input().split())
    if B-A<=2:
        print(1+K)
        exit()
    now = 1
    K -= (A-1)
    now = A
    if K%2==0:
        now += (B-A)*(K//2)
    else:
        now += (B-A)*((K-1)//2)
        now += 1
    print(now)  
if __name__ == '__main__':
    main()

Solution (Python):
n,a,b = map(int,input().split())
n += 1
if a+2<=b and n>=a+2:
  x = n-(a+2)
  y = x//2
  z = x%2
  ans = b+y*(b-a)+z
else:
  ans = n
print(ans)

Solution (Python):
import sys

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

if (b-a) < 2:
	print(1+n)
	sys.exit()
else:
	n -= (a-1)
	ans = a
	ans += (b-a)*(n//2)
	if n % 2 == 1:
		ans += 1


print(ans)

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

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

max_change = max(0, (k - (a - 1)) // 2)
print(max(k+1, 1+k-max_change*2 + (b-a)*max_change))

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

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

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

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

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

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

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

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

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

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

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())
k = K
if A >= B:
    print(K + 1)
else:
    K -= A - 1
    ans = A
    ans += (K // 2) * (B - A)
    ans += K % 2
    print(max(ans, k + 1))

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

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

Solution (Python):

import sys


def solve(K: int, A: int, B: int):
    if B-A < 2:
        print(K+1)
    else:
        remain_c = K + 1 - A
        ans = A + (remain_c//2) * (B-A) + remain_c%2
        print(ans)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(K, A, B)

if __name__ == '__main__':
    main()

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

K += 1

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

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