#P2134. 百日旅行

百日旅行

Description

Xiaoming and Xiaohong have nn days of vacation left, and Xiaoming can plan the trip. If they travel for xx consecutive days, Xiaoming needs to spend p×x×xp \times x \times x yuan. If they do not travel for xx consecutive days, Xiaoming needs to treat Xiaohong to meals, costing q×xq \times x yuan (p,qp, q are constants given in the input).

Please help Xiaoming write a program to compute the minimum total amount he needs to spend during the vacation.

Input Format

The input contains a single line with three space-separated positive integers n,p,qn, p, q.

Output Format

Output one line with a single positive integer, representing the minimum amount of money Xiaoming needs to spend.

6 1 7
20

Hint

Constraints

  • For 20%20\% of the testdata, 1n201 \le n \le 20.
  • For 90%90\% of the testdata, 1n1031 \le n \le 10^3, 1p2×1031 \le p \le 2 \times 10^3, 1q1041 \le q \le 10^4.
  • For 100%100\% of the testdata, 1n2×1051 \le n \le 2 \times 10^5, 1pq1041 \le p \le q \le 10^4.

Translated by ChatGPT 5