Marathon weekend with restrictions
Product of digits
Given an integer n. Write a program to find the minimal positive integer k such that the product of its digits is exactly n.
There are several tests. Each test consists of an integer n (0 ≤ n ≤
109) on a single line.
For each integer print in a single line the corresponding number k. If such k doesn't exist, print -1 instead.
15 128 255
35 288 -1