Beginner's Task-5

3

1 votes
Problem

The task of beginners' is to find the maximum value which can be obtained by numbers x, y, z. Maximum Value can be obtained by inserting sign of operations '+' and ''*, and brackets between the numbers so that the resulting value is as large as possible.
Example:
Let x,y,z be 2, 3,4 respectively. Some ways of obtaining maximum value are:

2+3*4=14  
2*(3+4)=14  
2*3*4=24  
2+3+4=9

You can insert operation signs only between x and y , and between y and z. You cannot swap numbers. Like (2+4)*3 is not allowed

The maximum value obtained in above example is 24.

Input
The input contains three integers x, y and z, each on a single line (1 <= x,y,z <= 10).

Output
Print the maximum value that you can obtain.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?