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
Input format:
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
Output format:
For each input case, output the result on a new line
Sample Input:
2
5 2
8 3
Sample Output:
2
10
Explanation for sample input: For N=5, there are 2 two digit numbers 51 and 15, the product of whose digits are N(=5).
Scoring:
Score = 500000/(C + 750*D + 50*O) where,
D: No. of Digits
C: Number of non whitespace characters
O: No. of single quotes (')
Time Limit:
3 s
Submit your solution
You need to be logged in to submit a solution.
discussions
| CodingCon | Ques |
| 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. |
| cjoa | Memory Limit |
| Q: | What's the limit on the memory our program can allocate? |
| A: | 64 MB. |
| turuthok | Constraint |
| Q: | Can N be <= 0? The constraint does not provide the lower limit for N and x. Please clarify. |
| A: | No. |
| hjain12345 | question |
| 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 |
| screw_it | Question |
| Q: | For case : 51 2 how is the answer 2.nShould it not be 0? |
| A: | The sample test case has been rectified. |
