The TerraTechnica (tech fest of NIT Delhi) is attracting lots of people. There is a long queue of people on the gate waiting to enter the event. Every person has a token which has a number written on it. All the numbers are sequential, means the token of the i th person contains the number i. But due to less availability of space, the fest manager decides to select some people and only allow them to enter the fest if they answer his question. He selects a person if and only if his/her token contains the number p, where p is between A and B (both inclusive). He allows them to enter the contest only if they answer his question which is.

"**Print sum of the powers of primes , that occur in the prime factorization of the numbers written on all the tokens of the selected candidates**".

As they know that you are very generous, they all ask you for help.

**Constraints:**

1 <= T <= 10

1 <= N <= 10^{12}

1 <= A <= B <= N

B - A <= 10^{5}

**Input:**

The first line of the input contains an integer T, denoting the test cases. Then T test cases follow. The first and the only line of each test case contains the number N, A and B, as described above.

**Output:**

Output of each test case contains a single integer which represents the sum of the powers of primes , that occur in the prime factorization of the numbers written on all the token of the selected persons.

**Example:
Input:**

1

14

9 12

**Output:**

8

**Explanation:**

For p=9, prime factorization is : 3^{2}

So, sum of the powers of primes is: 2

For p=10, prime factorization is : 2^{1}x5^{1}

So, sum of the powers of primes is: 2

For p=11, prime factorization is : 11^{1}

So, sum of the powers of primes is: 1

For p=12, prime factorization is : 2^{2}x 3^{1}

So, sum of powers of primes is: 3

Therefore the total sum is 2+2+1+3=8.

Author: tanujyadav97

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Vagesh Verma | 98 |

UrGuru | 98 |

chaolinyu | 84 |

prernaus24 | 83 |

devendrachoudhary5485 | 74 |

abducodes | 624 |

harshtyagi36 | 298 |

highway_to_hell | 252 |

rajeswarii | 248 |

arpit_anshuman | 240 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.