Product of digits
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given an integer n. Write a program to find the minimal positive integer k such that the product of its digits is exactly n.
Input
There are several tests. Each test consists of an integer n (0 ≤ n ≤ 10^9
) on a single line.
Output
For each integer print in a single line the corresponding number k. If such k doesn't exist, print -1 instead.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 14%