1093. Digital Product

单点时限: 6.0 sec

内存限制: 256 MB

Given an integer N, write a program to find the minimal positive integer K such that the product of the digits of K is exactly N.

输入格式

There are several tests. Each test consists of an integer N(0 <= N <= 10^9) on a single line. Input is terminated by end of file.

输出格式

For each integer in the input, print in a single line the corresponding number K. If such a K doesn’t exist, print -1 instead. No other characters are allowed in the output.

样例

Input
15
5
Output
35
5

45 人解决,78 人已尝试。

71 份提交通过,共有 318 份提交。

5.1 EMB 奖励。

创建: 17 年,1 月前.

修改: 6 年,8 月前.

最后提交: 3 年,5 月前.

来源: partychen

题目标签