Test Cases for this problem are available now. Click here to download
Product (Problem 5)
Given two numbers x and N, find the number of x-digit numbers whose product of digits is N
First line of input contains n(<20),the number of test cases.
Next n lines contain two numbers N(<10^6) and x(<12) each
For each input case, output the result on a new line
2 5 2 8 3
Explanation for sample input: For N=5, there are 2 two digit numbers 51 and 15, the product of whose digits are N(=5).
Score = 500000/(C + 750*D + 50*O) where,
D: No. of Digits
C: Number of non whitespace characters
O: No. of single quotes (')
Submit your solution
You need to be logged in to submit a solution.
|Q:||In Ques2 it was mentioned that Judges' is a 64- bit compiler. Is it true for all Questions, i.e., Am I expected to get some other value for sizeOf operator than what I see on my gcc compiler?|
|A:||Yes, Judge is a 64-bit compiler for all problems.|
|Q:||What's the limit on the memory our program can allocate?|
|Q:||Can N be <= 0? The constraint does not provide the lower limit for N and x. Please clarify.|
|Q:||for case n=5 and x=2 is 2 .Could it not be 5?|
|A:||For N=5,K=2 only two 2-digit numbers are possible 51 and 15, whose product is N=5|
|Q:||For case : 51 2 how is the answer 2.nShould it not be 0?|
|A:||The sample test case has been rectified.|