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:
4
2 5 1
4 10 2
14 15 2
2 20 3
Output:
4
2
2
0
- 1≤T≤10000
- 2≤A≤B≤100000
- 1≤K≤5