URAL 2066. Simple Expression

来源:互联网 发布:袜子推荐 知乎 编辑:程序博客网 时间:2024/06/06 19:30

2066. Simple Expression

Time limit: 1.0 second
Memory limit: 64 MB
You probably know that Alex is a very serious mathematician and he likes to solve serious problems. This is another problem from Alex.
You are given three nonnegative integers abc. You have to arrange them in some order and put +, − or × signs between them to minimize the outcome of the resulting expression. You are not allowed to use unary minus and parentheses in the expression. There must be exactly one sign between every pair of neighbouring numbers. You should use standard order for performing operations (multiplication first, addition and subtraction then).

Input

There are three lines with one integer in each line. The numbers are arranged in non-decreasing order (0 ≤ a ≤ b ≤ c ≤ 100).

Output

Print one number — the minimal outcome.

Sample

inputoutput
123
-5



水题,有a,b,c三个数字,在之间添加 " + ", " - ", " * "使得结果最小
暴力枚举



0 0
原创粉丝点击