equation

TimeLimit:1000ms  MemoryLimit:128000KB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description
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.

Input
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.
Output
For each test case, output the case number first, then output the value as large as the number f could be.

SampleInput
4
1 1 1 1
1 2 3 4
-2 -1 1 2
0 0 0 0
SampleOutput
Case 1: 3
Case 2: 21
Case 3: 3
Case 4: 0
Submit
题目统计信息详细
总AC数28
通过人数20
尝试人数24
总提交量62
AC率32.26%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: