{"raw_statement":[{"iden":"problem statement","content":"A fruit store sells apples.  \nYou may perform the following operations as many times as you want in any order:\n\n*   Buy one apple for $X$ yen (the currency in Japan).\n*   Buy three apples for $Y$ yen.\n\nHow much yen do you need to pay to obtain **exactly** $N$ apples?"},{"iden":"constraints","content":"*   $1 \\leq X \\leq Y \\leq 100$\n*   $1 \\leq N \\leq 100$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$X$ $Y$ $N$"},{"iden":"sample input 1","content":"10 25 10"},{"iden":"sample output 1","content":"85\n\nBuy three apples for $25$ yen three times and one apple for $10$ yen, and you will obtain exactly $10$ apples for a total of $85$ yen.  \nYou cannot obtain exactly $10$ apples for a lower cost, so the answer is $85$ yen."},{"iden":"sample input 2","content":"10 40 10"},{"iden":"sample output 2","content":"100\n\nIt is optimal to buy an apple for $10$ yen $10$ times."},{"iden":"sample input 3","content":"100 100 2"},{"iden":"sample output 3","content":"200\n\nThe only way to obtain **exactly** $2$ apples is to buy an apple for $100$ yen twice."},{"iden":"sample input 4","content":"100 100 100"},{"iden":"sample output 4","content":"3400"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}