#1130. B

B

说明

One day Fat Brother get a equation f=(x1+x2)*x3+x4 and four integers y1, y2, y3, y4, he wants to replace each unknown number xi by a known integer yj and make f to be as large as possible. As Fat Brother is taking part in the civil service’s examination, he has no time to deal with it. So your task is to help him calculating this value. Note that the correspondence relation should be one to one.

输入格式

The first line contains only one integer T, which is the number of test cases.
Each test case starts with four integers’ y1, y2, y3, y4 which describe above.

输出格式

For each test case, output the case number first, then output the value as large as the number f could be.

4
1 1 1 1
1 2 3 4
-2 -1 1 2
0 0 0 0
Case 1: 3
Case 2: 21
Case 3: 3
Case 4: 0

提示

T<=100

-10086 <= y1, y2, ycc3, y4 <= 10086

来源

去年校赛 洛谷