Score : $300$ points
You are given an integer $N$. Consider permuting the digits in $N$ and separate them into two positive integers.
For example, for the integer $123$, there are six ways to separate it, as follows:
Here, the two integers after separation must not contain leading zeros. For example, it is not allowed to separate the integer $101$ into $1$ and $01$. Additionally, since the resulting integers must be positive, it is not allowed to separate $101$ into $11$ and $0$, either.
What is the maximum possible product of the two resulting integers, obtained by the optimal separation?
Input is given from Standard Input in the following format:
$N$
Print the maximum possible product of the two integers after separation.
123
63
As described in Problem Statement, there are six ways to separate it:
The products of these pairs, in this order, are $36$, $63$, $26$, $62$, $23$, $32$, with $63$ being the maximum.
1010
100
There are two ways to separate it:
In either case, the product is $100$.
998244353
939337176