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

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

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

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

Solution (Python):

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

if B-A <= 2 or A >= K+1:
    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):
K,A,B = map(int,input().split())

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

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

Solution (Python):
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7



K, A, B = list(map(int, sys.stdin.buffer.readline().split()))

count = 1


count += min(K, A - 1)
K -= min(K, A - 1)

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


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

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

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

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

Solution (Python):
from sys import stdin
K, A, B = [int(_) for _ in stdin.readline().rstrip().split()]
if K < A-1 or B-A <= 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):
def main():
    K,A,B = map(int,input().split())
    sum = K+1
    
    if A + 2>= B or K <= A:
        print(K+1)
    else:
        if (K-A+1)%2 == 0:
            sum = (((K-A+1)//2)-1)*(B-A)+B
        else:
            sum = (((K-A+1)//2)-1)*(B-A)+1+B
        print(sum)
main()

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

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

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

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

Solution (Python):

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

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

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

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

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

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

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random

import os
 




 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    K,A,B = inputMap()
    
    if A+2 >= B:
        print(1+K)
        sys.exit()
        
    sai = A+1
    ans = 1
    if K < sai:
        print(1+K)
        sys.exit()
        
    else:
        sai = A-1
        K = K-sai
        
        if K % 2 == 1:
            K -= 1
            ans = 1
            kai = int(K / 2)
            ans += (B-A)*kai
            ans += A
            
        else:
            kai = int(K / 2)
            ans = (B-A)*kai
            ans += A
        
    print(ans)
    
    
    
if __name__ == "__main__":
	main()

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

Solution (Python):
import math
k, a, b = map(int, input().split())
q, r = divmod(k - a + 1, 2)
print(max(k + 1, a + q * (b - a) + r))

Solution (Python):
from sys import stdin

k,a,b = [int(x) for x in stdin.readline().rstrip().split()]

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

maisu = a
kaisu = a-1

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

print(maisu)

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

Solution (Python):


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

ans = 1


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


if B - A > 2:
  d, m = divmod(K, 2)
  ans += d * (B - A) + m
else:
  ans += K
print(ans)

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

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

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

Solution (Python):
K, A, B = map(int, input().split())
answer = 1
if B - A <= 2:
    
    answer += K
else:
    time = A - 1 
    if time + 2 > K or B - A < 2:
        answer += K
    else:
        answer += time
        q, mod = divmod(K-time, 2)
        answer += q * (B-A)
        answer += mod
print(answer)

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

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

S=K+1
diff=B-A
t=((K-A+1)//2)
T=diff*t
odd=((K-A+1)%2)
print(max(T+odd+A,S))

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

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

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

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


x = a - 1


y = k - x

iteration, res = divmod(y, 2)

print(max(a + iteration*(b-a) + res, k+1))

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

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

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

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

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

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

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

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





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

Solution (Python):
def solve(k, a, b):
    if b - a > 2:
        t = k - a + 1
        if t % 2 == 0:
            c = (b-a) * (t // 2)
            c += a
        else:
            c = (b-a) * (t // 2)
            c += a + 1
        return max(k+1, c)
    else:
        return k+1

assert solve(4,2,6) == 7
assert solve(7,3,4) == 8
assert solve(314159265, 35897932, 384626433) == 48518828981938099

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

Solution (Python):

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

d = k - a + 1

if d >= 0:
    if b-a >= 2:
        step = b-a
    else:
        step = 2

ans = 1 

if d % 2 == 0:
    ans += d//2 * step + a - 1
else:
    ans += d//2 * step + a

print(ans)

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

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

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

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


if __name__ == "__main__":
    resolve()

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

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

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

Solution (Python):

def main():
    K, A, B = map(int, open(0).read().split())
    if B - A <= 2 or K < A - 1:  
        print(K + 1)
        return
    ans, K = A, K - (A - 1)
    if K % 2:
        K -= 1
        ans += 1
    ans += (B - A) * K // 2
    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
def main():

    K, A, B = map(int, input().split())
    if B <= A:
        return K+1
    else:
        if A-1 >= K:
            return K+1
        else:
            L = K - (A-1) 
            v = A
            v += (B-A) * (L // 2)
            if L % 2 == 1:
                v += 1
            return max(v, K+1)


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

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

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


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

    
    K -= 2
    ans = B

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

    
    ans += K % 2

    print(ans)

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

Solution (Python):
from collections import Counter,defaultdict
import sys,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

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

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

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


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

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

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

Solution (Python):
def main():
  [k,a,b]=[int(x) for x in input().split()]
  
  if b-a<=2:
    print(k+1)
    exit()
  res=0
  while k>a:
    k-=2
    res+=b-a
  print(res+k+1)

if __name__ == '__main__':
  main()

Solution (Python):
import sys
def main():
    def input():
        return sys.stdin.readline()[:-1]
    K, A, B = map(int,input().split())
    if A+2 >= B:
        print(K+1)
    else:
        t = (K-A+1)//2
        if (K-A+1)%2 == 0:
            print(max(K+1, A+(B-A)*t))
        else:
            print(max(K+1, 1+A+(B-A)*t))

if __name__ == '__main__':
    main()

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

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


k, a, b = li()

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

Solution (Python):
from sys import stdin
K,A,B=[int(x) for x in stdin.readline().rstrip().split()]

ans1 = K + 1
ans2 = 0

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

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

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

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


def intelliegnt():
    if b > a + 2 and k > a - 1:
        kk = k
        kk -= a - 1
        print(a + ((b - a) * (kk // 2)) + kk % 2)

    else:
        print(1 + k)


def greedy():
    biscuit = 1
    yen = 0

    for i in range(k):
        if yen > 0:
            yen -= 1
            biscuit += b
        elif b > a + 2 and biscuit >= a and (k - i) > 1:
            biscuit -= a
            yen += 1
        else:
            biscuit += 1

    print(biscuit)


if __name__ == "__main__":
    intelliegnt()

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

ans_1 = k+1
t = k - a + 1

ans_2 = (b-a)*(t//2) + a + (t%2) 
print(max(ans_1,ans_2))

Solution (Python):



import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from fractions import Fraction

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

Solution (Python):
K,A,B=map(int,input().split())
num=1
count=0
num+=A-1
count+=A-1
if B-A>=2:
  val=(K-count)//2
  num+=val*(B-A)
  count+=2*val

if count!=K:
  val2=K-count
  num+=val2
  count+=val2
print(num)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

change = (B - A) > 2

bisket = 1
t = min(A-1,K)
bisket += t
K -= t
if not change:
    bisket += K
else:
    q,r = divmod(K,2)
    bisket += (B-A) * q + r

print(bisket)

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

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

if B - A <= 2:
    print(K+1)
else:
    m = max(0, (K-A+1)//2)
    
    ans = m * (B-A) + K - m * 2 + 1
    print(ans)

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

K -= A - 1 

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

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

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

print(ans)

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

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

bis=a
t=k-(a-1)

bis+=(t//2)*(b-a)
t-=(t//2)*2

bis+=t
print(bis)

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

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

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

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

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

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

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

Solution (Python):

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

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


if __name__ == "__main__":
    main()

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

Solution (Python):

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

    cockie = 1
    i = 0
    while i < num:
        if b - a > 2:
            if cockie >= a:
                if i <= num - 2:
                    cockie += (b - a) * ((num - i) // 2)
                    i += ((num - i) // 2) * 2
                else:
                    cockie += num - i
                    i += num - i
            else:
                i += a - cockie
                cockie += a - cockie
        else:
            cockie += num
            i += num

    print(cockie)





if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

r=b-a

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

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

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

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

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

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

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

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

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

Solution (Python):
K , A,B=  list(map(int,input().split(" ")))
num = 1
if A>=B - 1 or A - 1 >  K:
    num += K

else:
    
    a = A -1
    num += a

    b = (K - a)//2
    nokori = (K - a)%2
    num += b* (B-A)

    num += nokori
print(num)

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

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

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

Solution (Python):
import math
K, A, B = map(int, input().split())
ans = 0
if K - A + 1 < 2:
    ans = K + 1
elif (K - A + 1) % 2 == 0:
    if B+(B-A) * (math.floor((K - A + 1) / 2)-1) > K + 1:
        ans = B+(B-A) * (math.floor((K - A + 1) / 2)-1)
    else:
        ans = K + 1
else:
    if B+(B-A) * (math.floor((K - A + 1) / 2)-1) + 1 > K + 1:
        ans = B+(B-A) * (math.floor((K - A + 1) / 2)-1) + 1
    else:
        ans = K+1
print("{}".format(ans))

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

Solution (Python):

"""
C - When I hit my pocket...
https://atcoder.jp/contests/yahoo-procon2019-qual/tasks/yahoo_procon2019_qual_c

"""
import sys


def solve(K, A, B):
    ans = 1
    if B-A <= 2 or (A-1) > K:
        return ans + K
    K -= (A-1)
    ans = A
    if K % 2:
        ans += 1
    rep = K // 2
    ans += (B - A) * rep
    return ans


def main(args):
    K, A, B = map(int, input().split())
    ans = solve(K, A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

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

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

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

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

Solution (Python):
if __name__=="__main__":
    K, A, B = input().split(' ')
    K = int(K)
    A = int(A)
    B = int(B)
    if B <= A or K + 1 <=A or B - A <= 2:
        print(K + 1)
    else:
        ans = 1
        K -= A - 1
        ans = A
        sum = int(K / 2)
        K = (K & 1)
        ans += (B - A) * sum
        print(ans + K)

Solution (Python):
if __name__=="__main__":
    K, A, B = input().split(' ')
    K = int(K)
    A = int(A)
    B = int(B)
    if B <= A or K + 1 <=A or B - A <= 2:
        print(K + 1)
    else:
        ans = 1
        K -= A - 1
        ans = A
        sum = int(K / 2)
        K = (K & 1)
        ans += (B - A) * sum
        print(ans + K)

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

Solution (Python):

import sys


def solve(K: int, A: int, B: int):
    if B - A <= 2 or K <= A:
        print(K + 1)
        return
    K -= A - 1
    ret = A + (K // 2) * (B - A) + K % 2
    print(ret)
    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):
import sys


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

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

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

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

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

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

Solution (Python):


"""
参考：https://emtubasa.hateblo.jp/entry/2019/02/12/003250
・問題の意味読み違えてた。
　A*2枚のビスケットがあったら2円分換金していいと思ってた。
　どうりでビスケット増え過ぎると思った。
"""

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

K,A,B=MAP()

rate=B/A
rest=K-(A-1)
bis=A

bis+=(B-A)*(rest//2)+(rest%2)

print(max(bis, K+1))