Question: Problem Statement We all know about divisor, dividend, quotient and remainder of a number. Now, you are given an integer N and A and an

Problem Statement
We all know about divisor, dividend, quotient and remainder of a number.
Now, you are given an integer N and A and an equation N=A*M + D, where you can
choose a positive Integer M, multiply it with A and add a divisor of M to make it equal
to N.
Now, for a given value of N and A, can you find the sum of the number of possible values of M that satisfy the given equation?
Input Format
The first line contains two integers, N and A
Output Format
A single integer representing the sum of the number of possible values of M which satisfies the given equation
Sample Testcase #0
Testcase Input
12345
Testcase Output
0
Explanation
There is no possible solution..

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!