## PRSQRFR - Perfect Composites

no tags

Rohil and Mahesh recently attended a class on Prime Numbers. They learnt about a term "Prime Score" which is defined for all N > 1. For a number N = p1a x p2b x p3b ... x pkm where p1,p2,...pk are prime factors of N, Prime Score of N = a+b+...+m. While Mahesh was interested only in primes, Rohil thought how about playing around with Composite Numbers. Both started discussing and found out something known as Perfect Composite Numbers. They defined a Composite number N as Perfect Composite if it is divisible by all the factors of its Prime Score.
Whoa!! That's a nice discovery both of them have made. Now, they are interested in finding the number of Perfect Composites between A and B (inclusive) having Prime Score K. They want you to write a program for the same.

INPUT SPECIFICATIONS

First line contains a single integer T <= 10000, the number of testcases. Each following line contains three integers A, B and K (2 <= A <= B <= 105  and  K >= 0).

OUTPUT SPECIFICATIONS

For each test case, print a single integer - the number of Perfect Composite numbers between A and B (inclusive) having Prime Score = K.

SAMPLE I/O

INPUT :

5
2 5 2
3 100 3
4 10 5
90 456 8
34 67 5

OUTPUT :

1
11
0
2
0