A * B
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
Your task is to find the minimal positive integer number Q so that the product of digits of Q is exactly equal to N.
输入
The first line of input contains T, number of test cases.
The following T lines each contain a single integer number N (0<=N<=2^31-1).
The following T lines each contain a single integer number N (0<=N<=2^31-1).
输出
For each test case, your program should first print to the output "Case #i:"(i is the case number) in one line, and then the number Q in the second line. If such a number does not exist print -1.
示例输入
1 10
示例输出
Case #1: 25
提示
输入一个数N;求一个最小的正整数Q,使它的各个位的乘积为N;如不存在输出-1;
来源
HDU sdlzx