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=map(int,input().split())
if b-a<2 or k<a+1: print(k+1)
else:
    p=(k-a+1)//2
    print((b-a)*p+k-p*2+1)

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

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

Solution (Python):
def c_biscuit(K, A, B):
    
    
    if B <= A + 2 or A >= K:
        return K + 1

    
    
    
    
    
    exchange_time, final_remain = divmod(K - (A - 1), 2)
    ans = A + (B - A) * exchange_time + final_remain
    return ans

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

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

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

print(bis)

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

sum = 0
if a >= b:
    
    
    sum = k + 1
else:
    
    diff = b - a
    if diff == 1:
        sum = k + 1
    elif diff == 2:
        sum = k + 1
    elif diff >= 3:
        
        rest = 1 + k - a

        if rest >= 0:
            if rest % 2 == 0:
                sum = a + ((diff) * int(rest / 2))


            else:
                
                sum = a + ((diff) * int((rest - 1) / 2)) + 1


        else:
            sum = k + 1
                
print(int(sum))

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

cookie = 0

if a + 2 >= b or k + 1 < a:
    cookie = k + 1
else:
    action = int((k-(a-1))/2)
    cookie = a
    if action >= 1:
        cookie += action*(b-a)
    if (k-(a-1))/2 - action > 0:
        cookie += 1

print('{}'.format(cookie))

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

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

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

if __name__ == "__main__":
    main()

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

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=a+(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:
  if k<=a:
    print(k+1)
  elif a+2 > b:
    print(k+1)
  else:
    saisyomade=a+1
    kk=k-saisyomade
    print(b+(kk//2)*(b-a)+kk%2)

Solution (Python):
def input_space():
    return list(map(int,input().split(" ")))

K,A,B=input_space()

if B-A<=2:
    res=K+1
else:
    c=B-A
    k=c-1
    t=max(0,(K-A+1)//2)
    mod=(K-A+1)%2
    res=A+t*c+mod



print(res)




'''
Solve[{c=B/A, k=c-1,  t=(K-A+1)/2,r=A+t*k*A},{r}]
'''

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

    if K < (A - 1):
        return 1 + K
    else:
        if (B - A) >= 2:
            K -= (A - 1)
            q, r = divmod(K, 2)
            return A + q * (B - A) + r
        else:
            return 1 + K


if __name__ == '__main__':
    print(solve())

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

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

    if c % 2 != 0:
        c -= 1
        num += 1

    num += c//2*(b-a)

    print(num)

Solution (Python):
def main():
    k,a,b=map(int, raw_input().split(" "))   
    if b-a<=2:    
        print(k+1)
        return
    x=a-1
    y=(k-x)/2
    z=k-x-2*y
    print(1+x+z+(b-a)*y)
    
main()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

def f(k,a,b):
    bsk = 1
    if (a+1)>=b or (k<(a+1)):
        bsk += k
        print(bsk)
        return
    else:
        k -= (a-1)
        bsk = a

    if k>=2:
        if k%2==0:
            bsk += (b-a)*(k//2)
        else:
            bsk += (b-a)*((k-1)//2)+1
    
    print(int(bsk))
    
    
f(k,a,b)

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

def solve(K, A, B):
    r = 1
    if B - A <= 2:
        return r + K
    x = min(A - 1, K)
    r += x
    K -= x
    
    if r >= A:
        x = K // 2
        r += x * (B - A)
        K -= x * 2
    
    r += K
    K -= K
    return r

print(solve(K, A, B))

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

if b - a  >= 2 and a < k:
	n = k - a - 1
	if n % 2 == 0:
		bis = b + (b - a) * int(n / 2)
	else:
		bis = b + (b - a) * int(n // 2) + 1

else:
	bis = k + 1

print(bis)

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



cnt = 1

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

rest = K - (A - 1)
cnt += (A - 1)

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

print(cnt)

Solution (Python):
def func():
    pass


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

    
    
    
    
    
    
    
    
    
    
    
    
    

    y = (k - (a - 1)) // 2

    
    

    
    

    
    

    c1 = y * (b - a) + a
    if (k - (a - 1)) % 2 == 0:
        pass
    else:
        c1 += 1

    print(max(c1, k + 1))


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math

lines = sys.stdin.readlines()
K, A, B = map(int, lines[0].split())
ans = 0

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

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

print(int(ans))

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

f = False

if a < b-1:
    f = True

if f == False:
    print(k + 1)

if f == True:
    if k <= a:
        print(k + 1)
        exit()
    k -= a - 1
    r = (b - a) * int(k / 2)
    if k % 2 == 1:
        print(r + a + 1)
    else:
        print(r+a)

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

Solution (Python):

from collections import defaultdict
K, A, B = map(int, input().split())
ans = 1
if K == 1:
    print(ans+K)
    exit()

if B - A <= 2.0:
    print(ans+K)
    exit()

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


x = (K - (A - 1))//2

ans += (B - A) * x + (K - 2*x)

print(ans)

Solution (Python):
s = input().split()
K = int(s[0])
A = int(s[1])
B = int(s[2])
 
bis = 1
 
if B-A >  2:
  change = 1
else:
  change = 0
 
if change == 0:
  bis = bis + K
else:
  i = A - 1
  bis  = A
  k = K - i
  bis += (k//2)*(B-A)
  bis += k %2
print(bis)

Solution (Python):
if __name__ == "__main__":
    K,A,B = map(int,input().split())
    
    if B - A <= 2:
        print(K + 1)
    else :
        
        if K <= A-1:
            print(1 + K)
        else:
            
            rest = K - (A - 1)
            if rest < 2:
                print(1 + K)
            else:
                q,r = divmod(rest,2)
                print(A + q * (B - A) + r)

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

Solution (Python):


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

def cal(K, A, B):
    BNUM = 1
    TRANS_GET = B - A
    
    counter = 0
    while counter < K:
        nokori = K - counter
        if BNUM >= A:
        
            if nokori >= 2:
                syou = int(nokori / 2)
                BNUM += TRANS_GET * syou
                counter += syou * 2
            else:
                
                BNUM += 1
                counter += 1
        else:
        
            atonanko = A - BNUM
            if atonanko <= nokori-2:
                BNUM += atonanko
                counter += atonanko
            else:
                BNUM += nokori
                break
    return BNUM


if B - A <= 2:
    max_b = 1 + K
else:
    max_b = cal(K, A, B)

print(max_b)

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

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

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

ans = 0
K += 1

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

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

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

print(res)

Solution (Python):

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

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

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

bis = 1

if B - A > 1:
    if K >= A + 1:
        
        koukan = (K - (A - 1)) // 2
        koukan_turn = koukan * 2
        nokori_turn = K - koukan_turn
        bis += koukan * (B - A) + nokori_turn
    else:
        bis += K
else:
    bis += K
    
print(bis)

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

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

print(ans)

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

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


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

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

def uru(t, bis): 
    c = min(t, int(bis/a)*2) 
    return int(c/2)*2, bis + (b - a)*int(c/2)

def sousa(t, bis): 
    req = max(a - bis, 0) + 2 
    
    if t< req: 
        print(bis + t)
        return 
    elif req >= b - a + (req - 2): 
        print(bis + t)
        return
    elif bis > a: 
        sousa(t - uru(t, bis)[0], uru(t, bis)[1])
    else: 
        sousa(t - req, bis + ((req - 2) - a + b)) 

import sys
sys.setrecursionlimit(5000000)
sousa(k, 1)

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

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

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

print(ans)

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

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


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




else:
	b = 1+K

print(b)

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


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




else:
	b = 1+K

print(b)

Solution (Python):

import sys





"""Template"""


class IP:
    """
    入力を取得するクラス
    """
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        
        
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x//y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)


"""ここからメインコード"""


def main():
    
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    k, a, b = ip.IL()
    K1 = k - (a + 1)
    n = K1 // 2
    print(max(k + 1, ((n + 1) * b - n * a + K1 % 2)))


main()

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

if abs(A-B) <= 1:
    print(K + 1)
elif A > B:
    print(K + 1)

else:
    cookie = B
    K = K-A-1

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

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


biscuits  = 1

if B - A > 2 and A <= K - 1:
    
    K -= A - 1
    biscuits += A - 1

    biscuits  += (B - A) * (K // 2)
    K -= (K // 2) * 2
    biscuits += K
else:
    biscuits  += K

print(biscuits)

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

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

  
  
  
  K -= A - 1
  N = K // 2
  mod = K % 2
  return A + (B - A) * N + mod

print(solve())

Solution (Python):
K, A, B = map(int,input().split())
biscuit = 1
yen = 0
if A >= B or B-A == 1:
    biscuit += K

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

print(biscuit)

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

if (k == 1):
    print(2)
    exit()

if (b <= (a + 1)):
    print(k + 1)
    exit()
else:
    tmp1 = k - (a - 1)
    sabun = b - a

    if (tmp1 % 2 == 0):
        bis = int((tmp1 / 2 - 1)) * int(sabun) + b
    else:
        zouka = int((tmp1 // 2 - 1)) * int(sabun)
        bis = zouka + b + 1

    print(bis)

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

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

bis = 0
K = K - (A+1)
bis = B

if B - A >= 2:
    k = K//2
    bis += (B-A)*k

    if K % 2 == 1:
        bis += 1

print(bis)

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

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

else:
    print(K + 1)

Solution (Python):
nData = []
nData  = input().rstrip().split(' ')

nAns=0
nK = int(nData[0])
nA = int(nData[1])
nB = int(nData[2])

if (nA>=nB-1) or (nA>=nK):
 nAns=nK+1
else:
 nTmp=nK - (nA-1)
 nTmp1=nTmp//2
 nTmp2=nTmp%2
 nAns=nA+(nB-nA)*(nTmp1)+nTmp2

print(nAns)

Solution (Python):

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

bis = 1

if k <= 1 or b <= a + 2 or k < a + 1:
    print(1 + k)
    exit()
else:
    bis = b
    k = k - ( a + 1)
    if not k == 0:
        bis += int(k / 2) * (b - a) + k % 2

print(bis)

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

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

ans += K

print(ans)

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

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

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

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

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

first_bis = min(K,A)-1
second_exchange = int((K-first_bis)/2)
final_bis = K-first_bis-second_exchange*2

if A<B-1:
    bis = 1+first_bis+second_exchange*(B-A)+final_bis
else:
    bis = K+1
    
print(bis)

Solution (Python):

import sys



def solve(lines):
    K,A,B = map(int, lines.pop(0).split(' '))
    if A >= B:
        print(K+1)
        sys.exit(0)
    elif B - A <= 2:
        print(K+1)
        sys.exit(0)

    if K < A+1:
        print(K+1)
        sys.exit(0)
    elif K == A+1 and K > B:
        print(K+1)
        sys.exit(0)

    K -= A+1
    res = B

    n = int(K / 2)
    res += n*(B-A)
    K -= 2 * n

    if K == 1:
        res += 1

    print(res)




lines = [x.strip() for x in sys.stdin.readlines()]




solve(lines)

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

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



if K + 2 < A or A + 2 > B:
    cookie = 1 + K
else:

    exchangeCount = (K - (A - 1)) // 2
    extraTapCount = (K - (A - 1)) % 2

    cookie = A

    cookie += (B - A) * exchangeCount

    cookie += extraTapCount

print(cookie)

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

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

print(res)

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

def f(K, A, B):
    if A >= B - 2 or K <= A:
        return K + 1
    
    

    
    K -= (A - 1)
    if K % 2 == 0:
        return A + (B - A) * (K // 2)
    else:
        return 1 + A + (B - A) * (K // 2)
    
ans = f(K, A, B)
print('%d'%ans)

Solution (Python):
def func():
    pass


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

    
    
    
    
    
    
    
    
    
    
    
    
    

    x = k - (a - 1)
    y = x // 2

    
    

    
    q = (y * (b - a) + (k - ((a - 1) + 2 * y)))
    print(max((q + a), k + 1))


if __name__ == '__main__':
    main()

Solution (Python):
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    K, A, B = il()
    ka = K - (A - 1)
    ans = (ka // 2 - 1) * (B - A) + B
    if ka % 2 == 1:
        ans += 1
    return max(K + 1, ans)


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

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

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


bis = 1

kaisu = 0

en = 0

if B <= A +  1:
    bis = bis + K
elif K <= A:
    bis = bis + K
else:
    K = K - (A - 1)
    bis = A
    K = K - 2
    bis = B
    
        
        
    
    
    if K % 2 == 0:
        
        w1 = int(K /2)
        w2 = B-A
        bis = bis + w1*w2
    else:
        
        w1 = int(K /2)
        w2 = B-A
        bis = bis + w1*w2 
        bis = bis +1


print(bis)

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

elif B-A==1:
    print(K+1)
    exit(0)

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

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

Solution (Python):
k,a,b=map(int,input().split())
ans=0
if a+1<=k and b>a+2:
  k=k-(a+1)
  ans+=b
  mul,mod=divmod(k,2)
  ans+=(mul)*(b-a)
  ans+=mod
  print(ans)
else:
  print(1+k)

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

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


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


roop_turn = a+2


if k < roop_turn-1:
    print(1 + k)
    exit()


ret = b


remaining = k - (roop_turn-1)

q, mod = divmod(remaining, 2)

ret += (b-a)*q + mod
print(ret)

Solution (Python):


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



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

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

need_turns = A + 1 + 1  
first_need_turns = need_turns - 1

if A + 2 > B or K < first_need_turns:  
    print(1 + K)
    exit()

ans = B  
K -= (need_turns - 1)



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

print(ans)

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

ans = 1
money = 0

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

else:
	ans += K

print(ans)

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

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

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

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

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

print(bs)

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

Solution (Python):

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

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

bis=1
en=0

if A+2>=B:
  ans=bis+n
else:
  if (n+1)>=(A+2):
    
    n-=(A-1)+2
    en+=1+n//2
    
    bis=B+(en-1)*(B-A)
    
    n=n%2
  if n==0:
    ans=bis
  else:
    ans=bis+n
print(ans)

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

Solution (Python):
import math
a,b,c=map(int, input().split(" "))
ans1=a+1

num1=a-b+1



ans2=((c-b))*(math.floor(num1/2))
ans2+=b+num1%2



print(max(ans1,ans2))

Solution (Python):

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


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


time = a - 1

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

print(ans)

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

bisket = 1

if B <= A + 1 :
    bisket = K + 1
elif K <= A :
    bisket = K + 1
else :
    exCount =  (K + 1 - A) // 2
    hit = (K + 1 - A) % 2
    bisket = exCount * (B-A) + A + hit

print(bisket)

Solution (Python):
K, A, B = (int(i) for i in input().split())
num = 1
while True:
    if A + 2 - num >= B:
        print(K + num)
        break
    elif num >= A and (K // 2) is not 0:
        print(num + (K // 2) * (B - A) + (K % 2))
        break
    elif K >= 2 and K >= (A + 2 - num):
        K -= (A + 2 - num)
        num = B
    else:
        print(K + num)
        break

Solution (Python):
"""
A+2 < B の場合はビスケットを換金した方が良い
ビスケットを(A-所持数)回叩く
ビスケットを1円に換金する（所持数=0)
ビスケットを1円でB枚購入する（所持数+=B）

それ以下の場合はビスケットを叩いた方が良い
ビスケットをK回叩く

換金する場合、ビスケットを叩いて増やすとは限らない


K:3, A:2, B:3
1. 叩いてビスケット2
2. 換金してビスケット0, 1円
3. 購入してビスケット3


K:3, A:2, B:3
1. 叩いてビスケット2
1. 叩いてビスケット3
1. 叩いてビスケット4

K:3, A:2, B:4
1. 叩いてビスケット2
2. 換金してビスケット0, 1円
3. 購入してビスケット4


K:3, A:2, B:5
1. 叩いてビスケット2
2. 換金してビスケット0, 1円
3. 購入してビスケット5


叩いてもAに到達できないなら交換しない (K < A-1)
レートがマイナスなら交換しない（A+2 >= B）

ビスケットをA枚にする (A-1回叩く）
換金する
購入する（B枚）
B >= A なら換金する
購入する（B枚）

"""

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

def count_cookie1():
    act = K-2
    act += 1
    cookie = act % A
    yen = act // A
    cookie += yen * B
    return cookie


def count_cookie2():
    global K, A, B
    cookie = 1
    while K > 0:
        print(K, A, cookie)
        if (K < A-cookie) or (A+2 >= B): 
            cookie += (K)
            return cookie
        elif (K >= A-cookie+2): 
            if (A-cookie) > 0:
                K -= (A-cookie)
            else:
                K -= 2

            cookie -= A
            cookie += B
        else: 
            K -= (A-cookie)
            cookie += (A-cookie)
    return cookie


"""
1. K段階の数直線を定義する
2. A枚までは+1ずつ増加する
3. 以降は2ステップごとに+(B-A)ずつ増加する
    3-1. 増加数がマイナスなら処理をキャンセルして残りK枚追加する
4. 残り1ステップ以下になったら+1ずつ増加する
5. 残りステップが0になったら終了
"""
def count_cookie3():
    global K, A, B
    cookie = 1

    
    if cookie < A:
        K -= (A-cookie)
        cookie = A
    
    n = K // 2
    if (B-A) > 2:
        cookie += (B-A)*n
    else:
        cookie += K
        K = 0
    
    n = K % 2
    cookie += n
    return cookie


if A+2 < B:
    cookie = count_cookie3()
else:
    cookie = K+1

print(cookie)

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

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

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