R3D3 spent some time on an internship in MDCS. After earning enough money, he decided to go on a holiday somewhere far, far away. He enjoyed suntanning, drinking alcohol-free cocktails and going to concerts of popular local bands. While listening to "The White Buttons" and their hit song "Dacan the Baker", he met another robot for whom he was sure is the love of his life. Well, his summer, at least. Anyway, R3D3 was too shy to approach his potential soulmate, so he decided to write her a love letter. However, he stumbled upon a problem. Due to a terrorist threat, the Intergalactic Space Police was monitoring all letters sent in the area. Thus, R3D3 decided to invent his own alphabet, for which he was sure his love would be able to decipher.
There are _n_ letters in R3D3’s alphabet, and he wants to represent each letter as a sequence of '_0_' and '_1_', so that no letter’s sequence is a prefix of another letter's sequence. Since the Intergalactic Space Communications Service has lately introduced a tax for invented alphabets, R3D3 must pay a certain amount of money for each bit in his alphabet’s code (check the sample test for clarifications). He is too lovestruck to think clearly, so he asked you for help.
Given the costs _c_0 and _c_1 for each '_0_' and '_1_' in R3D3’s alphabet, respectively, you should come up with a coding for the alphabet (with properties as above) with minimum total cost.
## Input
The first line of input contains three integers _n_ (2 ≤ _n_ ≤ 108), _c_0 and _c_1 (0 ≤ _c_0, _c_1 ≤ 108) — the number of letters in the alphabet, and costs of '_0_' and '_1_', respectively.
## Output
Output a single integer — minimum possible total a cost of the whole alphabet.
[samples]
## Note
There are 4 letters in the alphabet. The optimal encoding is "_00_", "_01_", "_10_", "_11_". There are 4 zeroes and 4 ones used, so the total cost is 4·1 + 4·2 = 12.
R3D3 在 MDCS 实习了一段时间。在赚够钱后,他决定去一个遥远的地方度假。他享受日光浴、饮用无酒精鸡尾酒,并观看当地流行乐队的演唱会。在聆听 "The White Buttons" 乐队及其热门歌曲 "Dacan the Baker" 时,他遇到了另一位机器人,他确信这就是他生命中的真爱——至少是夏天的真爱。无论如何,R3D3 太害羞而不敢接近他的潜在灵魂伴侣,于是决定给她写一封情书。然而,他遇到了一个问题。由于恐怖主义威胁,星际太空警察正在监控该区域内发送的所有信件。因此,R3D3 决定发明自己的字母表,并确信他的爱人能够破译它。
R3D3 的字母表中有 #cf_span[n] 个字母,他希望将每个字母表示为由 '_0_' 和 '_1_' 组成的序列,使得任意一个字母的序列都不是另一个字母序列的前缀。由于星际太空通信服务最近对发明的字母表征收税款,R3D3 需要为字母表编码中的每一位支付一定金额(详见样例测试)。他因陷入爱河而无法清晰思考,因此向你寻求帮助。
给定 R3D3 字母表中每个 '_0_' 和 '_1_' 的成本分别为 #cf_span[c0] 和 #cf_span[c1],你需要设计一种满足上述性质的编码方案,使得总成本最小。
输入的第一行包含三个整数 #cf_span[n] (#cf_span[2 ≤ n ≤ 108])、#cf_span[c0] 和 #cf_span[c1] (#cf_span[0 ≤ c0, c1 ≤ 108]) —— 分别表示字母表中字母的数量,以及 '_0_' 和 '_1_' 的成本。
请输出一个整数——整个字母表的最小可能总成本。
字母表中有 #cf_span[4] 个字母。最优编码为 "_00_"、"_01_"、"_10_"、"_11_"。共使用了 #cf_span[4] 个零和 #cf_span[4] 个一,因此总成本为 #cf_span[4·1 + 4·2 = 12]。
## Input
输入的第一行包含三个整数 #cf_span[n] (#cf_span[2 ≤ n ≤ 108])、#cf_span[c0] 和 #cf_span[c1] (#cf_span[0 ≤ c0, c1 ≤ 108]) —— 分别表示字母表中字母的数量,以及 '_0_' 和 '_1_' 的成本。
## Output
请输出一个整数——整个字母表的最小可能总成本。
[samples]
## Note
字母表中有 #cf_span[4] 个字母。最优编码为 "_00_"、"_01_"、"_10_"、"_11_"。共使用了 #cf_span[4] 个零和 #cf_span[4] 个一,因此总成本为 #cf_span[4·1 + 4·2 = 12]。
**Definitions**
Let $ n \in \mathbb{Z} $ be the number of letters in the alphabet, with $ 2 \leq n \leq 10^8 $.
Let $ c_0, c_1 \in \mathbb{Z}_{\geq 0} $ be the cost per bit for '0' and '1', respectively.
**Constraints**
The encoding must be a prefix-free binary code (i.e., a binary tree with $ n $ leaves, no codeword is a prefix of another).
**Objective**
Minimize the total cost:
$$
\min \sum_{i=1}^{n} \left( c_0 \cdot (\text{number of '0's in codeword } i) + c_1 \cdot (\text{number of '1's in codeword } i) \right)
$$
over all prefix-free binary codes with $ n $ codewords.