#804. 买水
买水
No submission language available for this problem.
买水
题目描述
狗想煮汤,它需要买 升水,附近的商店只有两种类型的瓶装水-一升的和两升的。
一升的瓶装水价格为 元,两升的瓶装水价格为 元, 狗希望尽可能少花钱,请你帮 狗计算购买 升水的最低金额。
输入格式
每个测试包含多个测试用例。
第一行包含测试用例的数量为 ()。测试用例的描述如下。
每个测试用例的一行包含三个整数 、 和 。(,)
输出格式
对于每个测试用例,输出购买 升水的最低金额。
样例 #1
样例输入 #1
4
10 1 3
7 3 2
1 1000 1
1000000000000 42 88
样例输出 #1
10
9
1000
42000000000000
Background
Special for beginners, ^_^
Description
Given two integers x and y, print the sum.
Format
Input
Two integers x and y, satisfying .
Output
One integer, the sum of x and y.
Samples
123 500
623
Limitation
1s, 1024KiB for each test case.