CF710E.Generate a String

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

zscoder wants to generate an input file for some programming competition problem.

His input is a string consisting of nn letters 'a'. He is too lazy to write a generator so he will manually generate the input in a text editor.

Initially, the text editor is empty. It takes him xx seconds to insert or delete a letter 'a' from the text file and yy seconds to copy the contents of the entire text file, and duplicate it.

zscoder wants to find the minimum amount of time needed for him to create the input file of exactly nn letters 'a'. Help him to determine the amount of time needed to generate the input.

输入格式

The only line contains three integers nn , xx and yy ( 1<=n<=1071<=n<=10^{7} , 1<=x,y<=1091<=x,y<=10^{9} ) — the number of letters 'a' in the input file and the parameters from the problem statement.

输出格式

Print the only integer tt — the minimum amount of time needed to generate the input file.

输入输出样例

  • 输入#1

    8 1 1
    

    输出#1

    4
    
  • 输入#2

    8 1 10
    

    输出#2

    8
    
首页