time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Kmes has written three integers a𝑎, b𝑏 and c𝑐 in order to remember that he has to give Noobish_Monk a×b×c𝑎×𝑏×𝑐 bananas.
Noobish_Monk has found these integers and decided to do the following at most 55 times:
- pick one of these integers;
- increase it by 11.
For example, if a=2𝑎=2, b=3𝑏=3 and c=4𝑐=4, then one can increase a𝑎 three times by one and increase b𝑏 two times. After that a=5𝑎=5, b=5𝑏=5, c=4𝑐=4. Then the total number of bananas will be 5×5×4=1005×5×4=100.
What is the maximum value of a×b×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≤t≤10001≤𝑡≤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≤a,b,c≤101≤𝑎,𝑏,𝑐≤10) — Kmes's integers.
Output
For each test case, output a single integer — the maximum amount of bananas Noobish_Monk can get.
Example
input
Copy
2
2 3 4
10 1 10
output
Copy
100 600
解题说明:水题,此题只需要每次将三个数字中最小的数字加一,这样才能保证最后乘积最大。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int a[4];
cin >> a[1] >> a[2] >> a[3];
for (int x = 1; x <= 5; x++)
{
sort(a + 1, a + 4);
a[1]++;
}
cout << a[1] * a[2] * a[3] << endl;
}
return 0;
}