1. 程式人生 > >牛客網暑期ACM多校訓練營(第五場)

牛客網暑期ACM多校訓練營(第五場)

bject desc price line 代碼 hot describe room acm

J-plan

題目描述

There are n students going to travel. And hotel has two types room:double room and triple room. The price of a double room is p2 and the price of a triple room is p3.Now you need to calulate the minimum total cost of these students.

輸入描述:

The first line has three integers n, p2, p3

輸出描述:

Output the minimum total cost.
示例1

輸入

4 2 3

輸出

4
示例2

輸入

5 1 3

輸出

3

備註:

1<=n<=10^9
1<=p2,p3<=10^9
解題思路:
AC代碼:

牛客網暑期ACM多校訓練營(第五場)