check whether two numbers have the same prime divisors
Answers
Answered by
0
heya ...here is the answer
I think it is ryt
I think it is ryt
Attachments:
Answered by
0
Check if a number is divisible by all prime divisors of another number
Given two integers. We need to find if the first number x is divisible by all prime divisors of y.
Examples:
Input : x = 120, y = 75
Output : Yes
Explanation :
120 = (2^3)*3*5
75 = 3*(5^2)
120 is divisible by both 3 and 5 which
are the prime divisors of 75. Hence,
answer is "Yes".
Input : x = 15, y = 6
Output : No
Explanation :
15 = 3*5.
6 = 2*3,
15 is not divisible by 2 which is a
prime divisor of 6. Hence, answer
is "No".
Similar questions