I understood the concept behind a factorial problem. I implemented the same but it shows WA for every test case. I am not able to figure out the mistake in my implementation. Any help is appreciated.
Link to my Solution: Click here
Problem Description:
A FACTORIAL PROBLEM
Mike found an interesting problem. In this problem you are given two integers, n and k. You need to find the the maximum value of x, such that, n! % kx = 0.
Input Format:
First line contains number of test cases, T. Each test case contains two integers each, n and k.
Constraints:
1<=T<=20 1<=n<=10^8 2<=k<=10^8
Output Format
Print the value of x for each test case.