Codeforces Round 957 (Div. 3) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

brute force

constructive algorithms

greedy

math

sortings

*800

No tag edit access

The problem statement has recently been changed. View the changes.

×
A. Only Pluses

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputKmes has written three integers $$$a$$$, $$$b$$$ and $$$c$$$ in order to remember that he has to give Noobish_Monk $$$a \times b \times c$$$ bananas.

Noobish_Monk has found these integers and decided to do the following at most $$$5$$$ times:

- pick one of these integers;
- increase it by $$$1$$$.

For example, if $$$a = 2$$$, $$$b = 3$$$ and $$$c = 4$$$, then one can increase $$$a$$$ three times by one and increase $$$b$$$ two times. After that $$$a = 5$$$, $$$b = 5$$$, $$$c = 4$$$. Then the total number of bananas will be $$$5 \times 5 \times 4 = 100$$$.

What is the maximum value of $$$a \times b \times c$$$ Noobish_Monk can achieve with these operations?

Input

Each test contains multiple test cases. The first line of input contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. The description of the test cases follows.

The first and only line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10$$$) — Kmes's integers.

Output

For each test case, output a single integer — the maximum amount of bananas Noobish_Monk can get.

Example

Input

22 3 410 1 10

Output

100 600

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/09/2024 22:46:57 (l3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|