Maximum Concatenated Product We are given a list of integers p1, ..., pk (not necessarily distinct) where each has a value between 1 and 9, inclusive. Using each of the p1, ..., pk exactly once, we can form concatenations of digits, to achieve a new list of numbers; we then output the product of this new list. The goal is to maximize this product by choosing the best concatenations of digits. 

For example, we are given the list: 2 3 2 (separated by spaces). We can form the following concatenations:


2 3 2 (product of these concatenations is 12)
23 2 (product is 46)
32 2 (product is 64)
22 3 (product is 66)


Since the largest product that we can form of concatenations is 66, we output that. 

Rules:


There must be at least one multiplication (i.e., you cannot just concatenate all of the digits and output that).
You cannot use any other operators other than multiplication, or insert parentheses, etc.
Assume that the list of integers given is separated by spaces, and all integers have values between 1 and 9.


Shortest code (in bytes) wins!

Test cases:

Input: 1 2 3; Output: 63 (i.e., 21*3)

Input: 2 5 9; Output: 468 (52*9)

Input: 1 2 3 4; Output: 1312 (41*32)
CJam, 32 28 23 12 bytes

0le!f{~*}:e&gt;


Try it online in the CJam interpreter.

Thanks to @user23013 for helping me save 16 whole bytes!

Idea

Permuting the characters in the input string divides it into integers (groups of consecutive digits) separated by spaces. By pushing a zero and then evaluating the permuted input string, we push two or more integers. Multiplying the topmost two will result either in the product of the input divided into exactly two integers or some suboptimal value.

Code

 le!         e# Push all possible character permutations of the input.
0   f{  }    e# For each permutation:
             e#   Push 0, then the permuted string.
      ~      e#   Evaluate the string. Pushes one or more integers.
       *     e#   Multiply the two topmost integers.
         :e&gt; e# Retrieve the greatest integer in the array.