A. Only Pluses

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;
}

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-14 21:50:02       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-14 21:50:02       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-14 21:50:02       58 阅读
  4. Python语言-面向对象

    2024-07-14 21:50:02       69 阅读

热门阅读

  1. 质量小议40 -- 合格

    2024-07-14 21:50:02       21 阅读
  2. IOS热门面试题(二)

    2024-07-14 21:50:02       20 阅读
  3. KVM-QEMU

    KVM-QEMU

    2024-07-14 21:50:02      13 阅读
  4. Linux重要知识点

    2024-07-14 21:50:02       18 阅读