Ram was busy calclutaing the factorials of some numbers. He saw a pattern in the number of zeros in the end of the factorial. Let n be the number and Z(n) be the number of zeros in the end of the factorial of n then for
x < y
Z (x) <= Z(y)
i.e. the function never decreases.
He is solving a problem and wants to calculate the sum of number of zeros in the end of factorial of numbers in the range [a,b] i,e, sum of the number of zeros in the end for the factorial for all numbers 'n' such that the number n<=b and n>=a. But n can be very large and he don`t want to solve the problem by himself and he has asked you to solve the problem. Help him to solve the problem.
Constraints:
T<=10^5
1<=a,b<=10^6
Input :
First line contains T number of test cases.
Then T lines follow each containing 2 integers a and b.
Output :
T lines each containing the sum of number of zeros for the numbers in range [a,b]
To be eligible for prizes you have to register for AlgoXtreme at the Zeitgeist site. To register visit Zeitgeist. Only those candidates who have registered on the Zeitgeist website for the AlgoXtreme contest will be eligible to avail the Prizes.
The number of zeros for number 2,3,4,5 are 0,0,0,1 so answer is 1.