Ash and Pikachu
Now Ash loves maths so he wants to increase pikachu's CP in such a way that after every increase we get CP value which has exactly 'K' unique prime factors. If every increase in CP is considered as a step, then what is the maximum number of steps in which he can attain its maximum CP value possible(* which also has exactly 'K' prime factors). If it is not possible to increase its CP value then print '-1'.
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains three space-separated integers X, Y and K.
1 < T < 105
1 ≤ X ≤ Y ≤ 106
0 ≤ K ≤ 10
For each test case, output the maximum number of steps.
3 5 1
3 6 2
3 10 3
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6|
Fetching successful submissions