Product of digits
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Find the largest positive integer which product of digits equals to the positive integer m, or print -1 if there no such number. Numbers that contain digits 0 and 1 are not considered.
Input
One integer m (2 ≤ m ≤ 10^3
).
Output
Print the largest positive integer which product of digits equals to m. Print -1 if such number does not exist.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 27%