• 沒有找到結果。

For a given non-negative integer number N , find the minimal natural Q such that the product of all digits of Q is equal N .

N/A
N/A
Protected

Academic year: 2021

Share "For a given non-negative integer number N , find the minimal natural Q such that the product of all digits of Q is equal N ."

Copied!
1
0
0

加載中.... (立即查看全文)

全文

(1)

For a given non-negative integer number N , find the minimal natural Q such that the product of all digits of Q is equal N .

Input

The first line of input contains one positive integer number, which is the number of data sets. Each subsequent line contains one data set which consists of one non-negative integer number N (0 ≤ N ≤ 10

9

).

Output

For each data set, write one line containing the corresponding natural number Q or ‘-1’ if Q does not exist.

Sample Input

3 1 10

123456789

Sample Output

1

25

-1

參考文獻

相關文件

More precisely, it is the problem of partitioning a positive integer m into n positive integers such that any of the numbers is less than the sum of the remaining n − 1

For periodic sequence (with period n) that has exactly one of each 1 ∼ n in any group, we can find the least upper bound of the number of converged-routes... Elementary number

{ As the number of dimensions d increases, the number of points n required to achieve a fair esti- mate of integral would increase dramatically, i.e., proportional to n d.. { Even

In Sections 3 and 6 (Theorems 3.1 and 6.1), we prove the following non-vanishing results without assuming the condition (3) in Conjecture 1.1, and the proof presented for the

The existence and the uniqueness of the same ratio points for given n and k.. The properties about geometric measurement for given n

Given a shift κ, if we want to compute the eigenvalue λ of A which is closest to κ, then we need to compute the eigenvalue δ of (11) such that |δ| is the smallest value of all of

Q: Can we at least find the exact string theory background that gives our universe. A: A

In particular, in the context of folded supersymmetry it is pointed out in Ref.[4] that production of the squirk-antisquirk pair ˜ Q ˜ Q ∗ at the large hadron collider (LHC)