1400: three numbers and two operators

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:232 解决:83

题目描述

Given any three integers, an ex pression is obtained by inserting a multiplication sign and a plus sign into the three numbers.
Find the maximum and minimum of this ex pression. (The three numbers can be interchanged.)


输入

Each group of data consists of one row, including three integers until the end of input 0 0 0.

输出

Each group outputs the maximum and minimum values, separated by spaces in the middle, and each group takes one row.

样例输入复制

1 2 3 1 1 1 0 0 0

样例输出复制

7 5 2 2

来源/分类

Baidu
map