Solve the programming task below in a Python markdown code block.
Alice and Bob are studying for their class test together. The topic of the test is Prime Numbers. The preparation is getting too boring for their liking. To make it interesting, they turn it into a game. The winner will get an ice-cream treat from the other.

The game is called Count K-Primes. A number is a $K$-prime if it has exactly $K$ distinct prime factors. The game is quite simple. Alice will give three numbers $A$, $B$ & $K$ to Bob. Bob needs to tell Alice the number of $K$-prime numbers between $A$ & $B$ (both inclusive). If Bob gives the correct answer, he gets a point. If not, Alice gets a point. They play this game $T$ times.

Bob hasn't prepared so well. But he really wants to win the game. He wants you to tell him the correct answer.

------  Input ------

First line of input contains a single integer $T$, the number of times they play. 
Each game is described in a single line containing the three numbers $A$,$B$ & $K$.

------  Output ------

For each game, output on a separate line the number of $K$-primes between $A$ & $B$.

------  Constraints: ------

$1 ≤ T ≤ 10000$  
$2 ≤ A ≤ B ≤ 100000$  
$1 ≤ K ≤ 5$

----- Sample Input 1 ------ 
4
2 5 1
4 10 2
14 15 2
2 20 3
----- Sample Output 1 ------ 
4
2
2
0
----- explanation 1 ------ 
Test case $1$: The range includes $4$ integers $\{2, 3, 4,5 \}$. We need to find the number of integers in this range having only $1$ distinct prime factor.
- For $2$, since it is prime, it has $1$ distinct prime factor.
- For $3$, since it is prime, it has $1$ distinct prime factor.
- For $4$, we can write it as $2\times 2$. Thus, it has $1$ distinct prime factor which is $2$.
- For $5$, since it is prime, it has $1$ distinct prime factor.

Thus, all $4$ integers in the given range are $1$-primes.

Test case $2$: The only *K-primes* in the given range are $6$ and $10$. This is because $6 = 2\times 3$ and $10 = 2\times 5$. Thus both these integers have $2$ distinct prime factors.

Test case $3$: The only *K-primes* in the given range are $14$ and $15$. This is because $14 = 2\times 7$ and $15 = 3\times 5$. Thus both these integers have $2$ distinct prime factors.

Test case $4$: There are no *K-primes* in the given range.