Problem:
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.

Incorrect submission (verdict: Wrong Answer):
# coding: utf-8
import sys
import collections

# import math
# import numpy as np


"""Template"""


class IP:
    
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        
        return int(self.input())

    def S(self):
        
        return self.input()

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

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

    def ILS(self, n):
        
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        
        
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    
                    # output.append(a[j])
                    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):
        
        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):
        
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        
        return -(-x//y)

    def ave(self, a):
        
        return sum(a) / len(a)





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

    
    k, a, b = ip.IL()
    n = 1
    m = 0
    i = 0

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

    else:
        p = a + 2
        num = (k - (a - 1)) // p
        pp = (b - a) * num
        print(p)
        print(pp)
        print(num)

        i = a + 1
        n = b
        n += pp
        i += num * p
        print(n, i)

        while i < k:
            print(i)
            if m >= 1:
                n += b * m
                m = 0
                print("4だよ", n, m)

            elif i == k - 1:
                n += 1
                print("最後だよ", n, m)

            elif a > n:
                print(n)
                u = a - n
                n += u
                i += u - 1
                print("1だよ", n, m)

            elif a <= n:
                u = n // a
                n -= u * a
                m += u
                i += u
                print(u)
                print("2だよ", n, m)
            else:
                n += 1
                print("3だよ", n, m)
            i += 1
        print(n)


main()


Fixed, accepted submission:
# coding: utf-8
import sys

# import math
# import numpy as np


"""Template"""


class IP:
    
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        
        return int(self.input())

    def S(self):
        
        return self.input()

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

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

    def ILS(self, n):
        
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        
        
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    
                    # output.append(a[j])
                    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):
        
        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):
        
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        
        return -(-x//y)

    def ave(self, a):
        
        return sum(a) / len(a)





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

    
    k, a, b = ip.IL()
    u = k - (a - 1)
    print(max(a + (u // 2) * (b - a) + u % 2, k + 1))
        

main()