CF1955A.Yogurt Sale

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Yogurt Sale

The price of one yogurt at the "Vosmiorochka" store is aa burles, but there is a promotion where you can buy two yogurts for bb burles.

Maxim needs to buy exactly nn yogurts. When buying two yogurts, he can choose to buy them at the regular price or at the promotion price.

What is the minimum amount of burles Maxim should spend to buy nn yogurts?

Input

The first line contains a single integer tt (1t1041 \le t \le {10}^{4}) — the number of test cases.

The first and only line of each test case contains three integers nn, aa, and bb (1n1001 \le n \le 100, 1a,b301 \le a, b \le 30) — the number of yogurts Maxim wants to buy, the price for one yogurt, and the price for two yogurts on promotion.

Output

For each test case, print in a separate line the minimum cost of buying nn yogurts at "Vosmiorochka".

Note

In the third test case of the example, it is more advantageous to buy three yogurts for 1515 burles than two for 1111 and one for 55.

In the fourth test case of the example, you need to buy four yogurts, each for 55 burles.

Samples

4
2 5 9
3 5 9
3 5 11
4 5 11
9
14
15
20

在线编程 IDE

建议全屏模式获得最佳体验