PROGRAMMING:room
Finally, it's vacation time. The teacher decided to lead the ACM team members out for a two-day trip. In this way, they need to find a place to stay for one night.
Coincidentally, the teacher led the team to such a hotel. This hotel only has double rooms (for two people at most) and triple rooms (for three people at most), but the prices are different. Now we count the teacher, there are a total of $$n $$individuals. The price of double rooms in the hotel is $$a $$yuan, and the price of triple rooms is $$B $$, Now the teacher wants to know how to arrange the room to minimize the cost. Can you help the teacher calculate the minimum cost?
###Input format:
The first line gives a positive integer, $$t (1 / le t / Le 1000) $, which represents the number of groups of test data.
Next, $$t $$line gives three positive integers $$n, a, B, 1, N, a, B, 10 ^ 9 $$, meaning as the title.
###Output format:
The output contains $$t $$rows, each corresponding to the output of a set of samples.
###Input example:
```in
two
2 20 200
3 20 20
```
###Output example:
```out
twenty
twenty
```
answer:If there is no answer, please comment
The following five cases can be taken as the minimum:
All people live in double rooms
$$(n + 1)/ 2 * a$$
2. Everyone lives in a double room, but there is one person who lives in a double room by himself.
Take out a double room brother, three people open a triple room.
$$
(n - 2) / 2 * a + b
$$
3. Everyone lives in three rooms
$$(n + 2) / 3 * b$$
4. Everyone lives in three rooms, but there are two people living in three rooms with one bed vacant
Put the two brothers in a double room
$$n / 3 * b + a$$
All people live in three rooms, one lives in three rooms
Take out a three brothers, so there are four people, open two double rooms.
$$(n - 2) / 3 * b + a + a$$
Coincidentally, the teacher led the team to such a hotel. This hotel only has double rooms (for two people at most) and triple rooms (for three people at most), but the prices are different. Now we count the teacher, there are a total of $$n $$individuals. The price of double rooms in the hotel is $$a $$yuan, and the price of triple rooms is $$B $$, Now the teacher wants to know how to arrange the room to minimize the cost. Can you help the teacher calculate the minimum cost?
###Input format:
The first line gives a positive integer, $$t (1 / le t / Le 1000) $, which represents the number of groups of test data.
Next, $$t $$line gives three positive integers $$n, a, B, 1, N, a, B, 10 ^ 9 $$, meaning as the title.
###Output format:
The output contains $$t $$rows, each corresponding to the output of a set of samples.
###Input example:
```in
two
2 20 200
3 20 20
```
###Output example:
```out
twenty
twenty
```
answer:If there is no answer, please comment
The following five cases can be taken as the minimum:
All people live in double rooms
$$(n + 1)/ 2 * a$$
2. Everyone lives in a double room, but there is one person who lives in a double room by himself.
Take out a double room brother, three people open a triple room.
$$
(n - 2) / 2 * a + b
$$
3. Everyone lives in three rooms
$$(n + 2) / 3 * b$$
4. Everyone lives in three rooms, but there are two people living in three rooms with one bed vacant
Put the two brothers in a double room
$$n / 3 * b + a$$
All people live in three rooms, one lives in three rooms
Take out a three brothers, so there are four people, open two double rooms.
$$(n - 2) / 3 * b + a + a$$