**Can anyone share their approach who had solved the problem?
Henry is a curious little boy. He likes to play around with numbers.One day, he defined a
function f for natural numbers such that:
f(X) = largest prime factor of X , where X > 1
For example: f(2) = 2
f(3) = 3
f(75) = 5
Now, Henry selected two integers A and B (A ≤ B) and counted all numbers X between A and B (both inclusive) such that f(X) = K. He found out that there are N such numbers.
After that Henry went for playing. When he returned home, he found out that he had forgotten
the upper limit of range i.e. the integer B. However, he remembers all other numbers i.e. A, K
Henry wants to find out B as soon as possible. Can you help him finding it?
If there are multiple possible values of B, output the least value out of those.
It is assured that the input will be in such a way that final value of B will be within the
range of long long int.
First line of input contains T, the number of test cases.
The only line of each test case contains three integers A, K and N.
For each test case, output a single line containing the integer B.
● 1 ≤ T ≤ 5
● 2 ≤ A ≤ 10
● 2 ≤ K ≤ 11 and K is a prime number
● 0 ≤ N ≤ 152319