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


CodingConQues
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.
cjoaMemory Limit
Q:What's the limit on the memory our program can allocate?
A:64 MB.
turuthokConstraint
Q:Can N be <= 0? The constraint does not provide the lower limit for N and x. Please clarify.
A:No.
hjain12345question
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_itQuestion
Q:For case : 51 2 how is the answer 2.nShould it not be 0?
A:The sample test case has been rectified.

Submissions
Remainder
1000 pt
You are not logged in
0 / 1389

Graph
2000 pt
You are not logged in
0 / 996

Calculator
2000 pt
You are not logged in
0 / 1315

Power
1000 pt
You are not logged in
0 / 2311

Product
1000 pt
You are not logged in
0 / 2325

TLE
1000 pt
You are not logged in
0 / 2777